refactor(components): [form] enhance scrollIntoViewOptions type (#21552)

This commit is contained in:
Zhong
2025-07-31 09:20:07 +08:00
committed by GitHub
parent 3182010562
commit 09df413426
2 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ form/accessibility
| size | Control the size of components in this form. | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | — |
| disabled | Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component. | ^[boolean] | false |
| scroll-to-error | When validation fails, scroll to the first error form entry. | ^[boolean] | false |
| scroll-into-view-options ^(2.3.2) | When validation fails, it scrolls to the first error item based on the scrollIntoView option. [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView). | ^[object]`Record<string, any>` / ^[boolean] | true |
| scroll-into-view-options ^(2.3.2) | When validation fails, it scrolls to the first error item based on the scrollIntoView option. [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView). | ^[object]`ScrollIntoViewOptions` / ^[boolean] | true |
### Form Events

View File

@ -105,7 +105,7 @@ export const formProps = buildProps({
* @description When validation fails, it scrolls to the first error item based on the scrollIntoView option.
*/
scrollIntoViewOptions: {
type: [Object, Boolean],
type: definePropType<ScrollIntoViewOptions | boolean>([Object, Boolean]),
default: true,
},
} as const)