3 ms·
I don't believe that will work since the input.value will become an empty string before you can do your replacement.
by idbehold 11y ago
I don't believe that will work since the input.value will become an empty string before you can do your replacement.
- eloisius 11y agoI think you would use a text input if you were writing your own component with better number behavior
- idbehold 11y agoYou'll trigger the wrong on-screen keyboard on mobile devices. There was talk about an inputmode attribute where you could specify "numeric" to instruct the OS to present the appropriate keyboard to the user without changing the input's behavior, but it isn't supported anywhere AFAIK.