feat: prevent input of non-numeric values ​​in numer input (#21562)

This commit is contained in:
CorrectRoad 2025-06-26 16:43:26 +08:00 • committed by GitHub
commit d2814650e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 9 deletions

View file

@ -55,8 +55,8 @@ export const InputNumber: FC<InputNumberProps> = (props) => {
return <div className={classNames('flex', wrapClassName)}>
<Input {...rest}
// disable default controller
type='text'
className={classNames('rounded-r-none', className)}
type='number'
className={classNames('no-spinner rounded-r-none', className)}
value={value}
max={max}
min={min}
@ -77,8 +77,8 @@ export const InputNumber: FC<InputNumberProps> = (props) => {
size={size}
/>
<div className={classNames(
'flex flex-col bg-components-input-bg-normal rounded-r-md border-l border-divider-subtle text-text-tertiary focus:shadow-xs',
disabled && 'opacity-50 cursor-not-allowed',
'flex flex-col rounded-r-md border-l border-divider-subtle bg-components-input-bg-normal text-text-tertiary focus:shadow-xs',
disabled && 'cursor-not-allowed opacity-50',
controlWrapClassName)}
>
<button