Created
August 6, 2022 17:12
-
-
Save TheoOliveira/75380321d31db8e2b8d9ad533f891cb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const preventMinus = (e) => { | |
| if (e.code === 'Minus') { | |
| e.preventDefault(); | |
| } | |
| }; | |
| <input | |
| type="number" | |
| min="0" | |
| onKeyPress={preventMinus} | |
| /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment