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

Add onPost/Pause and onPost/Unpause hooks #948

Closed
stefcameron opened this issue Mar 8, 2023 Discussed in #942 · 1 comment · Fixed by focus-trap/focus-trap#914 or #949
Closed

Add onPost/Pause and onPost/Unpause hooks #948

stefcameron opened this issue Mar 8, 2023 Discussed in #942 · 1 comment · Fixed by focus-trap/focus-trap#914 or #949

Comments

@stefcameron
Copy link
Member

Discussed in #942

Originally posted by AlexKDawson March 6, 2023
So I have nested Traps, both with the prop clickOutsideDeactivates. However when I click outside both traps while the inner one is active only the inner one closes.

Is there a pattern I can use to close both traps if the click is outside of both, or just the inner trap if the click is outside the inner trap but within the outer one?

These new hooks should help with this use case.

@stefcameron
Copy link
Member Author

The pause/unpause hooks are in focus-trap v7.4.0 and focus-trap-react v10.1.1.

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