[Bug] `<SearchField />` trigger `onSubmit` when pressing Enter is used for completing IME
Discussed in https://github.com/adobe/react-spectrum/discussions/6332
Originally posted by QzCurious May 6, 2024 Though I use IME, but I only learned that it somehow relate to how I type/construct Chinese characters. I don't know it in any technical aspect.
It's recorded from official docs here. What I'm doing is:
- Click on
<SearchField />and ready for typing - Switch IME for typing Chinese characters
- Start typing some primitives to construct the words
"被送出" - While I type, you can tell that I'm "constructing" by the underline
- Whenever I'm done constructing, I press "Enter" to construct/complete the words
"被送出" - The bug happened
https://github.com/adobe/react-spectrum/assets/38932402/fd6505b4-10cf-44a7-8417-3d24abe79b44
I though this behavior is caused by trigger onSubmit directly by keypress on "Enter" key (Have been discussed a bit on https://github.com/adobe/react-spectrum/discussions/5774#discussioncomment-8310540).
At this point, I'd like to argue again that instead of having a custom onSubmit implementation, not interrupting browser default behavior for "Enter on an input" might be a better approach .
I didn't notice you create a issue for my discussion. I think you can close it as the bug already solved by #6404.