Repository navigation
fix(runtime): fire multi-word capture listeners - #7045
Merged
Merged
Conversation
Contributor
|
Hey @marcomattes thanks for this but non v5-specific fixes like this should go into main / v4 still atm and come into v5 downstream 🙏 |
marcomattes
force-pushed
the
fix/capture-listeners
branch
from
November 26, 2026 12:24
a2366ca to
f605ddd
Compare
Contributor
Author
|
Thanks @johnjenkins, makes sense! I've retargeted this to |
johnjenkins
enabled auto-merge (squash)
November 26, 2026 23:16
johnjenkins
pushed a commit
that referenced
this pull request
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the current behavior?
Multi-word standard events with a
Capturesuffix (e.g.onKeyDownCapture,onMouseDownCapture,onPointerDownCapture) never fire.setAccessoronly lowercases the event name whenon<name>exists onwindow;onkeydowncapturedoes not, so the listener falls through to the custom-event branch and is registered forkeyDowninstead ofkeydown.GitHub Issue Number: N/A
What is the new behavior?
If the member name ends in
Captureand the name without that suffix is a standard event onwindow, the event name is lowercased and the capture suffix handled as usual, soonKeyDownCapturelistens forkeydownwithcapture: true.onGotPointerCapture) are still non-capture listeners.Capturesuffix (onMyCustomEventCapture) keep their case.Documentation
N/A
Does this introduce a breaking change?
Testing
Added unit tests in
src/runtime/vdom/test/set-accessor.spec.tsforonKeyDownCapture,onMouseDownCapture,onPointerDownCapture,onGotPointerCaptureCapture(add + remove),onGotPointerCapture(non-capture) andonMyCustomEventCapture(custom event case preserved). Run withnpm run test.jest -- set-accessor.Other information
N/A