Skip to content
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

Built-in support for enter key #1023

Open
fredericDelaporte opened this issue Oct 2, 2019 · 0 comments
Open

Built-in support for enter key #1023

fredericDelaporte opened this issue Oct 2, 2019 · 0 comments
Labels
Feature Feature requests/suggestions

Comments

@fredericDelaporte
Copy link

fredericDelaporte commented Oct 2, 2019

#724 is a great addition, and thanks for that.
Now that the slider can have the focus, I think it should also trigger the form default button when an user hit enter, if the slider has focus and lies within a form, as would do most form fields.

Details about implicit form submission are here. The default button is the first submit button in document tree order in the form, even if disabled. The implicit submission implies triggering the click on the default button, if there is one and if the button is enabled, otherwise do nothing. The form should not be directly submitted. (It would cause it to miss the default button name/value pair in the submitted data.)

Maybe there will be some subtleties to handle. Like if the update event fires on blur, special care should be taken to ensure any pending update has been fired before triggering implicit submission.
And it may not be that easy to pick the default button: as far as I understand the spec, it would be first among input[type=submit], button:not([type=reset]):not([type=button]), in css notation. On button tag, a missing or invalid type defaults it to be a submit button.

@leongersen leongersen added the Feature Feature requests/suggestions label Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature requests/suggestions
Projects
None yet
Development

No branches or pull requests

2 participants