Fix actions dropdown focus timing - #1761
Merged
Merged
Conversation
PVince81
requested review from
ChristophWurst,
juliusknorr,
marcoambrosini and
raimund-schluessler
March 12, 2021 15:27
PVince81
commented
Mar 12, 2021
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 <vincent@nextcloud.com>
PVince81
force-pushed
the
bugfix/1760/fix-popover-initial-focus
branch
from
March 12, 2021 15:29
aaf88c2 to
a3774bc
Compare
Contributor
Author
|
tldr; fixes keyboard navigation for after opening the menu 😄 |
skjnldsv
requested changes
Mar 15, 2021
| }, | ||
| (val) => { | ||
| if (val) { | ||
| this.$emit('after-show') |
Contributor
There was a problem hiding this comment.
Please document those events
Contributor
There was a problem hiding this comment.
@PVince81 you can document them for our styleguide directly, no need for a readme :)
https://vue-styleguidist.github.io/docs/Documenting.html#events
marcoambrosini
approved these changes
Mar 15, 2021
Contributor
Author
|
@skjnldsv docs added |
skjnldsv
requested changes
Mar 16, 2021
| }, | ||
| (val) => { | ||
| if (val) { | ||
| this.$emit('after-show') |
Contributor
There was a problem hiding this comment.
@PVince81 you can document them for our styleguide directly, no need for a readme :)
https://vue-styleguidist.github.io/docs/Documenting.html#events
PVince81
force-pushed
the
bugfix/1760/fix-popover-initial-focus
branch
from
March 16, 2021 15:57
f5c4b76 to
b42b0f4
Compare
Contributor
Author
|
@skjnldsv nice, thanks for the hint. I've reverted the bits in the header and added docs close to |
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
PVince81
force-pushed
the
bugfix/1760/fix-popover-initial-focus
branch
from
March 16, 2021 15:59
b42b0f4 to
960e91e
Compare
4 tasks
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.


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.