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

Replace shouldReturnFocusAfterClose={boolean} with returnFocusTo={Element} #991

Open
diasbruno opened this issue Nov 18, 2022 · 3 comments
Projects

Comments

@diasbruno
Copy link
Collaborator

diasbruno commented Nov 18, 2022

This must be an element that will gain focus after the modal
is closed.

The default behavior should be to return the focus to the element
on document.activeElement before open the modal, but...
in some browsers, this behavior is broken so we can't always
trust it.

So, the user must pass to this attribute an element
that must receive the focus later.

@diasbruno diasbruno created this issue from a note in v4 (Todo) Nov 18, 2022
@gautamz07
Copy link

@diasbruno any pr's for this ? or you currently working on this ?

@diasbruno
Copy link
Collaborator Author

@gautamz07 Take a look at this branch https://github.com/reactjs/react-modal/tree/v4 I think I've deprecated shouldReturnFocusAfterClose and need to add returnFocusTo.

@diasbruno
Copy link
Collaborator Author

If you want, just go ahead and take over...

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

No branches or pull requests

2 participants