Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix: set min value in page settings (#6852)

Roman Sergeev499050547974
diff --git a/packages/docs-ui/src/views/page-settings/index.tsx b/packages/docs-ui/src/views/page-settings/index.tsx
index 9b554d7204..7db798f631 100644
--- a/packages/docs-ui/src/views/page-settings/index.tsx
+++ b/packages/docs-ui/src/views/page-settings/index.tsx
@@ -147,6 +147,7 @@ export function PageSettings(props: IConfirmChildrenProps) {
</label>
<InputNumber
precision={2}
+ min={0}
max={settings.pageSise.height / 2}
value={settings.margins.top}
onChange={(e) => handleMarginChange('top', e)}
@@ -158,6 +159,7 @@ export function PageSettings(props: IConfirmChildrenProps) {
</label>
<InputNumber
precision={2}
+ min={0}
max={settings.pageSise.height / 2}
value={settings.margins.bottom}
onChange={(e) => handleMarginChange('bottom', e)}
@@ -171,6 +173,7 @@ export function PageSettings(props: IConfirmChildrenProps) {
</label>
<InputNumber
precision={2}
+ min={0}
max={settings.pageSise.width / 2}
value={settings.margins.left}
onChange={(e) => handleMarginChange('left', e)}
@@ -182,6 +185,7 @@ export function PageSettings(props: IConfirmChildrenProps) {
</label>
<InputNumber
precision={2}
+ min={0}
max={settings.pageSise.width / 2}
value={settings.margins.right}
onChange={(e) => handleMarginChange('right', e)}