-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-toolbar and sidenav focus problems #5563
Comments
This is my first opportunity for fixing the problem with the focus of the md-button in the toolbar. But the thing I don't understand is, this feature has a sense, so removing isn't a good an idea. Please @Owners tell me more about that. Possibility 1: Fixes angular#5563
…oring. Thats possibility two, to fix that issue with the focus, more information here angular#5563 Fixes angular#5563
cc @marcysutton I believe that focus is there on purpose for accessibility reasons (indicates to keyboard users where the focus is). |
That's why I thought about creating an extra attribute which prevents focus recovery. If you found a good solution, you can tell me :) |
Rather than providing a way to break accessibility, a proper solution for this would involve something like #5189: only show the focus style on keyboard interaction. Mouse users wouldn't see it. We definitely should not provide hooks to disable accessibility features, but rather apply those features in more specific ways. |
https://github.com/ten1seven/what-input That isn't a good solution for detecting the interaction type, because then I need to bind a listener on the Should I instead check for the global input methods? (like: |
Did you look at the library? It is checking global input methods. Consumers of the library don't have to do anything except include it and write some CSS. That said, I didn't think we would necessarily use a third-party lib in Angular Material, but I wanted to float it up as an example. |
Yeah, I took a look at it ;), so we should provide an own version of that with less features? |
That's the idea, yes. We don't need the full event API, just input detection allowing us to apply focus styles on keyboard interaction only. |
Normally the Sidenav restores every time the last active element, so the focus won't disappear from the triggered button after closing the sidenav Fixes angular#5563
I created a PR, I already tested it on my local environment. Now it only restores the focus if I trigger the sidenav with keyboard. If there are any suggestions please tell me |
Sidenav want's to restore focus after the pane gets closed, this should only happen for keyboard interactions. The service got created to use that feature for other components too Fixes angular#5563 References angular#5583
Sidenav want's to restore focus after the pane gets closed, this should only happen for keyboard interactions. The service got created to use that feature for other components too Fixes angular#5563 References angular#5583 feat(interaction): add test for interaction which fakes a keyboard input and validates it test(interaction): add interaction spec for mousedown event + formats 4 spaces to 2 style(interaction): fix styling of the previous commits
Sidenav want's to restore focus after the pane gets closed, this should only happen for keyboard interactions. The service got created to use that feature for other components too Fixes angular#5563 Fixes angular#5434 Closes angular#5583 Closes angular#5589 feat(interaction): add test for interaction which fakes a keyboard input and validates it test(interaction): add interaction spec for mousedown event + formats 4 spaces to 2 style(interaction): fix styling of the previous commits
Sidenav want's to restore focus after the pane gets closed, this should only happen for keyboard interactions. The service got created to use that feature for other components too Fixes angular#5563 Fixes angular#5434 Closes angular#5583 Closes angular#5589 feat(interaction): add test for interaction which fakes a keyboard input and validates it test(interaction): add interaction spec for mousedown event + formats 4 spaces to 2 style(interaction): fix styling of the previous commits test(sidenav): add sidenav focus restore test triggered by keyboard test(sidenav): add focus restore test for mouse and patch other one fix(sidenav): test
Sidenav want's to restore focus after the pane gets closed, this should only happen for keyboard interactions. The service got created to use that feature for other components too Fixes angular#5563 Fixes angular#5434 Closes angular#5583 Closes angular#5589 feat(interaction): add test for interaction which fakes a keyboard input and validates it test(interaction): add interaction spec for mousedown event + formats 4 spaces to 2 style(interaction): fix styling of the previous commits test(sidenav): add sidenav focus restore test triggered by keyboard test(sidenav): add focus restore test for mouse and patch other one fix(sidenav): test fix(sidenav): replace deprecated methods, and remove aria label test(sidenav): revert deprecated methods.
Hey, Just wondering what the status on this? I'm currently seeing the same behavior where focus is still set to the button after closing the sidenav. Thanks! |
@cmacdonnacha Yeah, it's unfortunately still pending. |
@devversion Thanks for the update. |
@devversion - what is the PR associated with this issue ? |
For testing purposes I tried to create a
sidenav
, which should be triggered by thetoolbar
But as you can see in the bad quality GIF, the css class
is-focused
will be added after dismissing the sidebar. So I already checked the code and I found this snippetI already fixed that in my version, but I want to ask the development team first about their thoughts.
So I created a merge for that, please take a look at it and tell me more about potential side-affects
@jelbourn @ThomasBurleson
The text was updated successfully, but these errors were encountered: