-
Notifications
You must be signed in to change notification settings - Fork 432
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(core/form/inputs): fix issue with tabbing to popover toolbar buttons in PT-input #5057
base: next
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Dec 13, 2024 3:37 PM (UTC) ❌ Failed Tests (8) -- expand for details
|
1c5d6a8
to
517727f
Compare
517727f
to
c8914ae
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.
Thanks @skogsmaskin, this is a huge improvement.
Just had a look and noticed a few things:
- When pressing TAB for the first time over an annotation, it will try focus the next element briefly before then focusing buttons within the popover.
If you look at this video and pay attention to the 'No items' box, you'll see what I mean:
Screenflick.Movie.30.mp4
I'm very certain this is the case due to buttonRef.current.focus()
being wrapped within a setTimeout
. This does seem like a bit of a smell!
One possible alternative is that rather than focusing the button directly, we create an invisible anchor element (with tabIndex=-1
), and then on TAB:
- initially focus the anchor element. Since it has
tabIndex=-1
, it will be ignored in sequential keyboard navigation - the browser will then 'naturally' tab to the next button in the list
Here's an example video with that approach:
Screenflick.Movie.31.mp4
-
This popover doesn't trap focus – making it very easy to accidentally tab or shift-tab away completely out of the form. We should probably trap focus here.
-
Focus isn't restored when closing the popover – ideally, closing the popover with ESC returns you exactly where you were.
We could probably punt on 2 + 3, but should capture these if we do.
@skogsmaskin I'm assuming that this PR can be closed? 👀 |
979a049
to
566e6b5
Compare
566e6b5
to
d8c8257
Compare
566e6b5
to
1adfba8
Compare
…able Text Input This will allow a user to purely use the keyboard when editing links and inline objects, which was not possible before.
… Portable Text Input
1adfba8
to
3de982b
Compare
Description
There is currently an issue with reaching the annotation and inline object edit toolbar buttons with the keyboard.
This will make sure that when these toolbars shows, it will be possible to press
Tab
in order to get to the buttons with the keyboard.Also added component tests for this.
What to review
That you are able to tab into the buttons when the toolbar is showing.
Notes for release