-
Notifications
You must be signed in to change notification settings - Fork 88
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
Focus first action after opening actions menu #3151
Conversation
This might be a problem of floating-vue: Akryum/floating-vue#872 actually, which automatically gives the focus to the popover. One can actually see, that the first action has focus for a short amount of time, and then loses it again. I don't see a way to disable this behavior, so the timeout might be our best option for now. |
/backport to stable6 |
I have a problem indirectly related to this. I didn't find the root cause, but I guess it is related to multiple focus traps activate at the same time.
|
I created a new issue for this #3154. |
It's fixed without this PR :) |
AH, not really. |
Signed-off-by: Raimund Schlüßler <[email protected]>
9a498b7
to
43b3a51
Compare
So, it is being focused, but pressing tab focus the first element again 🤔 |
Indeed, it works as it is now with Akryum/floating-vue#894. I just checked before touching this PR again, and it didn't, but that was probably a caching issue, I guess.
What do you mean? After opening the Actions menu, keydown or tab moves to the second action, as it was before we moved to floating-vue. This is how I would expect it to work.
I was just checking my stale PRs in this repo, and thought it would be an easy fix. Which it turned out to be, since it was in fact working already. Hence, closing the PR. |
Thanks @raimund-schluessler ! 🚀 |
This is a dirty hack to solve #3053 and get keyboard navigation in the Actions menu to work without pressing tab once.
I have honestly no idea why a timeout is necessary here. All my attempts of using nextTick or listening for floating-vue events (even with #3149 included) did not succeed. The menu is open, and the button is there and defined, but still
focus()
does nothing when called without a timeout directly after the menu was open. The timeout duration is chosen arbitrarily, a timeout of 1 ms works for me as well (0 does not).Maybe this inspires someone to find the correct solution, if not, I think the PR at least does not make it worse 🙈