Skip to content
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(material/sidenav): restore focus with correct origin when closing via the backdrop #23492

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

crisbeto
Copy link
Member

Currently when a sidenav is closed, we restore the focus origin as when it was focused because we don't know what kind of event closed it, however if it happens through the backdrop, we can be fairly certain that it was via mouse.

These changes pass in the mouse origin when closing through the backdrop.

Fixes #23484.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Aug 30, 2021
@crisbeto crisbeto requested a review from devversion August 30, 2021 18:46
@crisbeto crisbeto requested a review from mmalerba as a code owner August 30, 2021 18:46
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 30, 2021
@crisbeto crisbeto changed the title fix(material/sidenav); restore focus with correct origin when closing via the backdrop fix(material/sidenav): restore focus with correct origin when closing via the backdrop Aug 30, 2021
… via the backdrop

Currently when a sidenav is closed, we restore the focus origin as when it was focused because we don't know what kind of event closed it, however if it happens through the backdrop, we can be fairly certain that it was via mouse.

These changes pass in the `mouse` origin when closing through the backdrop.

Fixes angular#23484.
@crisbeto crisbeto force-pushed the 23484/sidenav-backdrop-focus branch from a5a85f2 to 46f7931 Compare August 30, 2021 20:05
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 31, 2021
@zarend zarend added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Sep 7, 2021
@zarend zarend merged commit 01734b3 into angular:master Sep 7, 2021
@zarend
Copy link
Contributor

zarend commented Sep 7, 2021

I could not merge this into patch due to merge conflict with 12.2.x.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(MatSidenav): Material button wrong state when toggling a sidenav after clicking the backdrop
3 participants