Fire keypress event for Enter, Shift+Enter, and Ctrl+Enter keys #392
+11
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For web compat and for interop with actual behavior in browsers, this change updates the spec to require firing
keypress
events for the Enter key and for the combination of the Enter key with the Shift or Ctrl keys.Otherwise, without this change, the spec is restricting implementations to requirements for
keypress
that are different from what browsers need to implement in order to be compatible with existing web content.As an example of a specific case where conforming to the current spec causes unexpected behavior:
Without this change, Ladybird — which has strictly implemented the spec as currently written — doesn’t work as expected when trying to send messages in the The Lounge • https://thelounge.chat/ web-based IRC client.
And in troubleshooting that problem, I noticed that The Lounge is a Vue-based app — so, out of curiosity, I did a search at https://github.com/search?q=%22%40keypress.enter%22+language%3AVue&type=code&l=Vue and found that there’s a whole lotta other Vue code out there in the wild that’s doing stuff with
@keypress.enter
.Closes #183, and closes #266.
The following tasks have been completed:
[There are existing errors; this change doesn’t introduce any new ones]
[I’m not aware of any WPT tests for this…]
Implementation commitment: