-
Notifications
You must be signed in to change notification settings - Fork 638
Make resize vertical splitter keyboard accessible #3903
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
Conversation
🦋 Changeset detectedLatest commit: 595fd42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
e869847
to
e19ca83
Compare
size-limit report 📦
|
Hi! (Probably an old bug that's only surfacing now) Ran into a strange issue where the position would move more and more every keystroke and found that handleKeyDragEnd is running more and more times with every keystroke 🤔 notice the count for console.log: events-not-detached.mov |
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.
Implementation looks great!
Found one strange bug, other than that, looks good!
a97d5da
to
c90baf5
Compare
Hi @siddharthkp - Thanks for flagging that! I noticed this bug too. The fix was to remove the event listeners in the |
c90baf5
to
ac62fd5
Compare
Yes, feels much better now! |
Optional side note 1: We change the cursor when dragging with pointer, should we also change it for keyboard or not? 🤔 Feels a tiny bit janky based on your keystrokes, but maybe it's fine. Leaving it up to you resize-cursor.movOptional side note 2: Not for this PR, but a future optimisation that would be nice is to make the resizing incrementally bigger the longer you press an arrow key (and then reset it after cool off period) |
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.
Left a few optional comments, approving from my side ✅
Pending:
- add changeset
- check with accessibility team
So I thought about this but imagined that if somebody is using only keyboard, they wouldn't use the mouse at all (which I believe gives that feeling.So they wouldn't see a mouse pointer? I'm not sure how usage for this will be like.
Great idea! I was kinda bored while testing this and this addition would be perfect. It would be fun to implement. Do you think it might have any accessibility penalty? Eric is on leave, whom would you recommend I tag for accessibility review? |
Ah yes, good point. I genuinely don't know if that's the case or not 😇
@ichelsea or @TylerJDev maybe? |
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 for looking for ways to continuously improve our components!
I'm not finding any issues with using the splitter with just my keyboard (and I'm also behind the idea to leave the cursor change alone when controlling with just the keyboard).
However, I'm unable to control this splitter component with VoiceOver on Safari or NVDA on Edge. It's read out to me, but the arrow keys just move me to the next element and there isn't an intuitive way to figure out how to use the control with a screen reader. I'm unsure of advice to give on this one as it dips into a more technical area that I'm unfamiliar with, so I'm going to tag in our accessibility engineering team to have a look while Eric is out 🙂.
@ichelsea What you are noticing is that the screen reader uses certain keys, in this case arrow keys, to interact with the virtual buffer. Essentially, the screen reader uses the arrow keys to move around the accessibility tree and not passing those key events back to the javascript.
And we should involve Tetralogical in this one 🤔 . Link to reading: Time to revisit accesskey? |
d9f9bcd
to
e26e7c3
Compare
4f714a2
to
2aab0bd
Compare
59fe7f5
to
0b3bf60
Compare
Taking this comment as confirmation to merge this.
|
Closes https://github.com/github/primer/issues/2810
Context
Earlier guidance for SplitPageLayout accessibility was to create a visually hidden form with range input to determine the position of the splitter. However this hidden form swallows the focus when tabbing through the page layout.
New
The proposed change here is to follow Window Splitter a11y guidelines and support keyboard navigation on the vertical splitter.
Screen.Recording.2023-11-03.at.8.38.29.pm.mov
Rollout strategy
Testing & Reviewing
Tab through the
Resizable Pane
storybook underPageLayout.features.stories
and navigate to focus on the vertical splitter. Use the left and right arrow keys to move it sideways. Use Voiceover to here the announcement on current pane width updated with every move.Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.