-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(multiple): change aria keyboard manager to only handle repeated events in correct places #32728
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
Conversation
366dfa3 to
4c5c3e0
Compare
4c5c3e0 to
f75d2e2
Compare
e65f6c8 to
35c6305
Compare
| * This library has not yet had a need for stopPropagationImmediate. | ||
| */ | ||
| export interface EventHandlerOptions { | ||
| handleRepeat?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might prefer preventRepeat instead. It makes it clearer what it is doing. I wasn't sure at first what handleRepeat was doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had ignoreRepeat but then I changed the default to ignore the repeat, and it is generally better to have defaults be false.
But we actually do default the others as true already, so I'll go back to that.
2df86f6 to
ee8f248
Compare
…vents in correct places
d898b53 to
c617fd7
Compare
The angular-aria keyboard manager ignores the event.repeat parameter so holding down a key will cause it to loop even when that behavior is not desired. In general, repeated events should only be handled when navigating with arrow keys, and especially not when toggling (as then it just goes from off to on to off and so on).
Another issue is that the browser can interpret a keyboard space or enter as a click in certain cases. This is true with the toolbar so added check for a proper mouse event to handle the click (else already handled with keyboard) as well as updated spec to pass a proper event.
Note: we are missing tests for this but they probably need to be added at a higher level so that we can catch for not just the repeat issue but also issues like the click above. Else can just add explicit repeat but keyDown events but that isn't as useful.
Fixes b/479281429.