Submit via enter doesn't work in number field #2797
-
I am using the useNumberField hook inside a form. This is not the case when using the useNumberField hook. Is this the expected behaviour or am I doing something wrong? And if it is expected, is there some work around I could use to get this working? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sounds like a bug, though I'm not seeing anywhere that we're mistakenly calling preventDefault from a quick glance. |
Beta Was this translation helpful? Give feedback.
Sounds like a bug, though I'm not seeing anywhere that we're mistakenly calling preventDefault from a quick glance.
We should only preventDefault if we're handling the key, but it looks like that's what we're doing.
Looked in react-aria/(textfield|spinbutton|numberfield) since those are the packages that build useNumberField
Would you mind opening an issue for this? Here's a codesandbox to reproduce it https://codesandbox.io/s/cocky-mclean-v66ml?file=/src/App.js
And it has a textfield to rule out that useTextfield is introducing the problem. Could be useFormattedTextfield though.