diff --git a/packages/components/input/src/use-input.ts b/packages/components/input/src/use-input.ts index 7d5e751d46..fbcf2c5d7f 100644 --- a/packages/components/input/src/use-input.ts +++ b/packages/components/input/src/use-input.ts @@ -82,6 +82,10 @@ export interface Props void; + /** + * disable the number chnage on scrolling + */ + disableScrollChange?: boolean; } type AutoCapitalize = AriaTextFieldOptions<"input">["autoCapitalize"]; @@ -116,6 +120,7 @@ export function useInput {}, + disableScrollChange, ...otherProps } = props; @@ -125,6 +130,11 @@ export function useInput) => { + if (disableScrollChange) { + (e.target as HTMLInputElement).blur(); + } + }; const [isFocusWithin, setFocusWithin] = useState(false); @@ -386,6 +396,7 @@ export function useInput