-
Notifications
You must be signed in to change notification settings - Fork 67
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
Multiple modals and returnFocus #68
Comments
Just in time ;) |
I'm sorry? I'm not quite sure what you mean? I tried to make it easy to reproduce. Did it make sense? Is it in scope for this library, or is it not? |
I mean that you created the issue just in time, when this package is under my attention. |
So - that's funny.
|
@theKashey: Thank you for looking into it. |
Issue resolved in v2.0.0. No API changes, except raising minimal React version to 16.8. |
@theKashey: Thanks a lot for the quick fix! It works great! |
I’m experiencing this now, with 2.2.1. The ‘inner’ modal returns focus correctly to its trigger element in the ‘outer’ modal, but the ‘outer’ modal is unable to return focus to its trigger element on the page. I also tried downgrading to 2.0.0 in case any regressions had been introduced since, unfortunately with no luck. |
Sounds like it's not working properly in deeply nested cases. |
To provide a bit more context to my use-case: My modals aren’t really structurally nested, they are both |
Actually, you can probably just close this issue again. Perhaps there could be a hint about this behavior in dev environments, but basically what happened is that I disable my initial trigger when it’s clicked so that it appears a certain way through the overlay. When the modal closes the button gets enabled again, but a timing issue (Framer Motion’s |
But are you able to resolve the issue, or focus-lock should add some timeout support to the return focus logic? |
It’s not super easy to solve it with the current tools provided with focus-lock, so maybe it would be a good idea to somehow have it trigger on an event, or after a timeout as you suggest. |
Sure. This might also resolve another issue with a too-fast move focus inside - theKashey/react-focus-on#36 |
This issue has been marked as "stale" because there has been no activity for 2 months. If you have any new information or would like to continue the discussion, please feel free to do so. If this issue got buried among other tasks, maybe this message will reignite the conversation. Otherwise, this issue will be closed in 7 days. Thank you for your contributions so far. |
Focus is not returned with multiple
<FocusLock>
s.Sample CRA project: https://github.com/andraaspar/react-focus-lock-stack-missing
To reproduce:
The text was updated successfully, but these errors were encountered: