feat: preven input value in number input

pull/21562/head
CorrectRoadH 11 months ago
parent ad9eebd02d
commit d9997b8e07

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

@ -697,4 +697,15 @@ button:focus-within {
-ms-overflow-style: none; -ms-overflow-style: none;
scrollbar-width: none; scrollbar-width: none;
} }
/* Hide arrows from number input */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.no-spinner {
-moz-appearance: textfield;
}
} }

Loading…
Cancel
Save