-
Notifications
You must be signed in to change notification settings - Fork 96
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
[feature] When modal is rendered into a certain node, esc
should close the modal when it's pressed within that node
#62
Comments
@everdimension: Can you please give a more concrete example of this use case? |
What do you mean? I just wish to optionally make it so that the |
I'm just trying to understand the use case here because it's not obvious to me. How do you hit escape outside the modal — did you turn off the focus trap? If so, and it doesn't appear like a modal on top of everything, I'm wondering what the modal provides for you. |
Use-case: application is integrated within another application, but not within an iframe. In this case the modal will be on top of everything within the integrated app, but the surroundings might still be available and interactive. I didn't think about how focus trap would allow you to go outside, though. But maybe this should be allowed, too, if the user, say, clicks somewhere outside. |
Ah, weird. I think it might be perfectly fine to attach the escape listener to the underlay instead of the document. That should solve things for you, right? |
Yeah, or better yet, we might just check inside the |
Yep, @everdimension, that sounds like a good plan. PR welcome. |
This might be optional behavior. Perhaps even a separate option altogether.
Something like a
rootNode
prop, maybe?The text was updated successfully, but these errors were encountered: