-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add accessibleFocus utility. #846
Conversation
This gives us the ability to augment focused styles and make them highly visible without affecting input devices that don't navigate around the UI using the keyboard.
028b594
to
4baa54c
Compare
I'm not sure if this is the right way to do this, but maybe I'm wrong. Might a better focus design help? |
I'm sorry but this seems based on a very wrong assumption, like if only keyboard users need a visible focus. It is also against the WCAG requirements. I'd also note that I don't see an issue related to this PR, nor I've heard of any public discussion about the introduction of this utility. |
Can you elaborate on this point?
This is pretty normal, development on the project is still moving quite quickly. It's fine to discuss the change here too. |
Ideally we'd have one button for both arrows and one would use arrow keys to navigate. Not sure if such a thing is possible, but it would work a but like |
It actually is pretty much like an |
(I'm assuming this is mainly to fix the prominence of the arrow button focus style.) |
There's a lot of elaboration on the specification this project should follow: Also, there's already an issue open about focus visibility: #574 I don't see the point in trying to detect keyboard usage. Focus indication is a requirement to implement for all users. If this is meant for implementing focus visibility just when some keyboard usage gets detected, then it's a very wrong assumption. Also, worth considering there are dozens of alternate pointing/input devices, some of them work in a sort of "keyboard emulation" that can't be detected. |
@afercia thanks for your feedback!
That wasn't really the assumption in the description. Reading the docs you linked to I also don't see where the implication that focus styles need to be the same for all contexts is established? I grabbed a few quick examples from how Apple, Chrome, and GitHub are doing focus visibility in a more surgical manner: Having the ability to set different focus styles when you are interacting with keyboard navigation from other interactions that don't rely on keyboard seem useful in crafting a more tailored UI. Small example of a distracting consequence of keyboard oriented focus styles applied during click behaviour which doesn't seem to be helping: https://cloudup.com/cz3K6JxKAOl |
@matias what I see in the browser toolbar is the platform specific (macOS) focus style applied on the browser frame. The focus style on the "Watch" GitHub button happens also on mouse click, it's just a different style on Quoting from the second link I posted:
That clarifies that a clear indication of focus is not only for keyboard users. Sure, it can be different but it must always be very clear so I'm wondering if it's really worth it making it different. The point of making the focus style "lighter" when not using a keyboard just doesn't meet the spec. |
Thinking more about this, it should be called |
Trying to find a way to make everyone happy. @afercia It looks like the video @matias shared shows an issue where the focus is temporarily moved to the "x" icon and then disappears, which is a bit strange and maybe it's also a accessibility issue? Not sure. Is there any way we can make this better? @matias Are there any other specific issues that you have in mind? |
@iseulde thanks for pointing me at the video. What I see there is a control that gets clicked: when clicked, is at the same time in an Sidebar: Quickly testing the sidebar on Chrome, when I press the X, focus is completely lost and the browser puts it back to the document root. This is the worst scenario where users would be forced to start content navigation again from the scratch. Navigation from the "Post Settings" button to the Sidebar is also a big concern. I thought the sidebar was supposed to be open by default, as I've been told in #467 |
Just a quick note to say it will be open by default, but if you dismiss it then it's cookied as dismissed until you toggle it back on again. But this is in part blocked also by #450, and representative only of the very in-flux state of development it's in right now. |
Thanks for the feedback @afercia! That |
Just to make it clear: I primarily added the focus styles to visualise where the the focus is. I knew there would be issues we'll have to improve, both in terms of design and accessibility, but at least now we see what needs to be improved. :) |
Yep worth noting the About the interaction with the sidebar, I'd propose to discuss that separately, there are a few basic a11y concepts to focus on. |
Yep, we should open separate PRs and tickets for separate issues. Feel free to make tickets for any issue you see, I'll have an eye on focus issues and make sure they get fixed. |
Should we close this pull request? |
+1 for close, I don't think this is the right solution. If this is going to stick around, it needs a rename to |
I think we can close it after reading all comments. @mtias feel free to reopen if you disagree with that. |
This utility gives us the ability to target
focus
styles and make them more prominently visible without affecting input devices that don't navigate around the UI using the keyboard.