Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(sidenav): Only restore focus if user interaction was keyboard #5583

Closed

Conversation

devversion
Copy link
Member

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 #5563

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
@devversion
Copy link
Member Author

I want to point to @marcysutton, what do you think?

@ThomasBurleson
Copy link
Contributor

@devversion - what do you mean point-to ? @marcysutton can you review this PR ?

@ThomasBurleson ThomasBurleson self-assigned this Nov 6, 2015
@marcysutton
Copy link
Contributor

I am currently traveling but I will review it when I get a chance.

@devversion
Copy link
Member Author

@ThomasBurleson Yeah I mean she should review my PR. And I have a little question to you, what means the new label?, can u even take a look at the code?

@marcysutton, @ThomasBurleson: I will try to improve / refactor that code


Perhaps I should provide a global service for the last interaction type?. Now the listener get registered foreach sidenav directive.
If there are more things to clear, I'm available on Gitter ;)

devversion added a commit to devversion/material that referenced this pull request Nov 6, 2015
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
@devversion
Copy link
Member Author

I created a second PR to fix that issue. This time its a feature which can be used in other components too (my favorite one). It got already tested manually.

@EladBezalel
Copy link
Member

@devversion as #5589 is the active PR can i close this one?

@devversion
Copy link
Member Author

@EladBezalel Yes, I prefer the #5589 PR, but keep this PR open, I'm still waiting for a decision, which variant we will take

devversion added a commit to devversion/material that referenced this pull request Nov 9, 2015
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
devversion added a commit to devversion/material that referenced this pull request Nov 9, 2015
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
@devversion
Copy link
Member Author

I think that's definitely the wrong way of implementation, so I will close this for cleanup purposes

@devversion devversion closed this Nov 9, 2015
devversion added a commit to devversion/material that referenced this pull request Nov 11, 2015
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
devversion added a commit to devversion/material that referenced this pull request Nov 12, 2015
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.
devversion added a commit to devversion/material that referenced this pull request Jan 24, 2016
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.
devversion added a commit to devversion/material that referenced this pull request Jan 24, 2016
devversion added a commit to devversion/material that referenced this pull request Jan 24, 2016
devversion added a commit to devversion/material that referenced this pull request Jan 24, 2016
devversion added a commit to devversion/material that referenced this pull request Mar 3, 2016
devversion added a commit to devversion/material that referenced this pull request Apr 7, 2016
devversion added a commit to devversion/material that referenced this pull request Apr 9, 2016
@devversion devversion deleted the fix/sidenav-focus-restore branch April 21, 2016 11:53
devversion added a commit to devversion/material that referenced this pull request Apr 22, 2016
devversion added a commit to devversion/material that referenced this pull request Aug 26, 2016
devversion added a commit to devversion/material that referenced this pull request Sep 19, 2016
kara pushed a commit that referenced this pull request Oct 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants