-
Notifications
You must be signed in to change notification settings - Fork 93
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
Fix actions dropdown focus timing #1761
Conversation
Because "@after-show" is still happening too early due to v-tooltip's use of "requestAnimationFrame" we can't rely on its events to tell us when the popover is actually visible. This workaround introduces an additional Popover event "after-show" and "after-hide" that are based on monitoring the inner "isOpen" property which is the one toggling the CSS visibility. The Actions popover logic now uses "after-show" to reliably apply the focus on the first action element. Signed-off-by: Vincent Petry <[email protected]>
aaf88c2
to
a3774bc
Compare
tldr; fixes keyboard navigation for after opening the menu 😄 |
}, | ||
(val) => { | ||
if (val) { | ||
this.$emit('after-show') |
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.
Please document those events
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.
@PVince81 you can document them for our styleguide directly, no need for a readme :)
https://vue-styleguidist.github.io/docs/Documenting.html#events
@skjnldsv docs added |
}, | ||
(val) => { | ||
if (val) { | ||
this.$emit('after-show') |
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.
@PVince81 you can document them for our styleguide directly, no need for a readme :)
https://vue-styleguidist.github.io/docs/Documenting.html#events
f5c4b76
to
b42b0f4
Compare
@skjnldsv nice, thanks for the hint. I've reverted the bits in the header and added docs close to |
Signed-off-by: Vincent Petry <[email protected]>
b42b0f4
to
960e91e
Compare
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.
Because "@after-show" is still happening too early due to v-tooltip's
use of "requestAnimationFrame" we can't rely on its events to tell us
when the popover is actually visible.
This workaround introduces an additional Popover event "after-show" and
"after-hide" that are based on monitoring the inner "isOpen" property
which is the one toggling the CSS visibility.
The Actions popover logic now uses "after-show" to reliably apply the
focus on the first action element.
Fixes #1760
See Akryum/floating-vue#661 for the upstream issue.