Skip to content

Commit

Permalink
feat: forbid entry 'e' and '.' in the number input
Browse files Browse the repository at this point in the history
BUN-162
  • Loading branch information
b3aton committed Aug 19, 2022
1 parent f6b618b commit e848ee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/storefront/src/components/form/B3TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const B3TextField = ({
}

const handleNumberInputKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
if (['ArrowUp', 'ArrowDown'].indexOf(event.code) > -1) {
if (['ArrowUp', 'ArrowDown', 'KeyE', 'Period'].indexOf(event.code) > -1) {
event.preventDefault()
}
}
Expand Down

0 comments on commit e848ee0

Please sign in to comment.