Skip to content

[fields] Fix to submit a form on Enter press with accessible DOM structure #17328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Apr 11, 2025

Fixes #13066.

No other solutions worked. 🤔
I was considering adding a docs section explaining how to achieve the form submission in userland until I thought of this. 🤷

  • Add tests asserting that form submission works as expected
  • Allow setting event.defaultMuiPrevented on the Text Field keyDown to avoid submitting the form
  • Remove the enterkeyhint setting on a section (spinbutton) since it didn't make sense, Clicking Enter did nothing... 🤷
  • Move the MuiEvent type to @mui/x-internals/types to have access to it on Pickers codebase as well

@LukasTy LukasTy added regression A bug, but worse component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition labels Apr 11, 2025
@LukasTy LukasTy added this to the 8.0.0 milestone Apr 11, 2025
@LukasTy LukasTy self-assigned this Apr 11, 2025
@mui-bot
Copy link

mui-bot commented Apr 11, 2025

Deploy preview: https://deploy-preview-17328--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against d0fd5b3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pickers][fields] Handle form submission when pressing Enter on fields with accessible DOM structure
2 participants