react-input
react-input copied to clipboard
Add Option To Prevent Negative Values
As the title says it would be a nice feature to have an option to block the input of negative values / the minus sign.
As the documentation suggests, you can specify the signDisplay property with a value of "never".
import { useNumberFormat } from "@react-input/number-format";
export default function Input() {
const inputRef = useNumberFormat({
signDisplay: "never",
});
return <input ref={inputRef} />;
}