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

[core] feat(Drawer): return focus to active element after closing #4422

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

adidahiya
Copy link
Contributor

Fixes #3592

Difficult to test because document.activeElement doesn't seem to update as expected in enzyme...

@adidahiya
Copy link
Contributor Author

works in Chrome & FF

@adidahiya adidahiya merged commit 241b20d into develop Nov 17, 2020
@adidahiya adidahiya deleted the ad/drawer-return-focus branch November 17, 2020 20:53
@Nantris
Copy link

Nantris commented Apr 2, 2021

Is some way to disable this available? We manage focus ourselves in our app, but this change prevents us from doing that, because it immediately undoes whatever we do and focuses the last document.activeElement.

@Nantris
Copy link

Nantris commented Apr 5, 2021

@adidahiya is there any way to circumvent this? If you know one, it would really help us a lot!

@adidahiya
Copy link
Contributor Author

@slapbox no, but we can add a prop which enables this behavior, something like returnFocusOnClose where it's set to true by default

@adidahiya
Copy link
Contributor Author

@slapbox see #4620

@Nantris
Copy link

Nantris commented Apr 6, 2021

Wow that was crazy fast to have a PR opened! Thanks for your attention on this @adidahiya!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Focus back to element when drawer close
3 participants