-
Notifications
You must be signed in to change notification settings - Fork 34
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
π <Listbox>
: 4 bug fixes for scrolling & focus
#81
π <Listbox>
: 4 bug fixes for scrolling & focus
#81
Conversation
This is a good catch; I was wondering about this! Is it possible for us to listen for the events during the capture phase as well to call |
05a672d
to
0eca5fa
Compare
0eca5fa has a potentially cleaner solution to this. We can |
0eca5fa
to
10483a6
Compare
@alexlafroscia @GavinJoyce I reckon this is ready to merge. This fixes two important bugs when embedding the listbox in a (long) form. |
Hey @dmcnamara-eng, sorry I can't push this through right now, I'm on my honeymoon and am not doing OSS while on vacation. I promise I'll check this out when I return next week! I've been a little neglectful of my OSS duties with the wedding but will be back with energy once I return home. |
c0b328e
to
34e7cc5
Compare
d4cb709
to
6503d67
Compare
Welcome back and congratulations @alexlafroscia π― π
Yay! This is a cleaner fix of course. Actually this behaviour is determined by I think we have covered a lot here. I can squash the commits before merging?
|
6503d67
to
fb8dde1
Compare
fb8dde1
to
d14513a
Compare
<Listbox>
: 4 bug fixes for scrolling & focus
I've cleaned this PR up and commit history for the following 4
We are using this branch in production and these fixes feel solid π Please π @alexlafroscia π₯ |
addon/components/listbox.js
Outdated
[ | ||
'ArrowUp', | ||
'ArrowDown', | ||
'ArrowLeft', | ||
'ArrowRight', | ||
'Home', | ||
'End', | ||
].indexOf(event.key) > -1 |
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.
Two tiny thoughts (neither of which are blockers here, by any means)
- We could move this array up to the module scope to avoid creating it on every
keydown
event from the user. - We could make it a
Set
instead of an array, which might make the code read a little more easily
if (HANDLED_KEYDOWN_EVENTS.has(event.key)) {
...
}
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.
π Agreed. Much cleaner and more performant. I've fixed that here: 6f34df6
e23360d
to
c0ebe7a
Compare
Thank you so much for all of your patience with me @dmcnamara-eng -- this looks great! Thank you for this PR π |
β¨ What Changed & Why
Fixes for the following 4
<Listbox>
bugs related to scrolling & focus: