Is it worth making OverlayContext available in public API? #9356
Replies: 2 comments 2 replies
-
|
We have some ongoing work on this which we're hoping to pick up again in the new year. I'm attaching some related discussions I found with a quick search, feel free to look for others and chime in on any that are specific to you. Out of curiosity, what, in OverlayContext, are you hoping would enable this? What is blocking you in snapshot testing? Can you close the modal before moving to the next step? |
Beta Was this translation helpful? Give feedback.
-
|
Hey, thank you for quick reply 🙇
Reading the source code, Of course, it would be much easier if
Sorry, should have been clearer: Snapshot testing works fine. Its just that we want the same Storybook story to be used for snapshot testing, documentation and general dev. You can see the issue here (try to use the main Storybook search box) We also use Supernova to embed Storybook inside documentation, and when you are in edit mode in Supernova, the modal rendering inside an iframe (Supernova uses a frame too, so we have nested frames here) makes it impossible to use any of the input fields in the editor. To be clear, I opened this in the hope of a quick workaround, I was aware of the discussions you linked. Personally I think that the focus scope should not extend beyond the iframe boundary by default (maybe I'm just missing cases where one would want this), or at least allow optionally sandboxing it to a frame, but it seems like it might take a while to get consensus on that. Left my 2c on the existing Storybook issue too, it is quite closely related, if a bit broader. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If
OverlayContextwas available, it would (I think?) offer consumers an escape hatch for focus trap issues in certain situations.For example, we have a
Modalcomponent based on theModalandModalOverlayfromreact-aria-components. If I had access to theOverlayContext, I could allow focusing on the Storybook search input when the component rendered in an open state in Storybook (which we need for snapshot testing).The
data-react-aria-top-layerapproach does not seem to work when theFocusScopeis inside an iframe, which is how Storybook renders components.Beta Was this translation helpful? Give feedback.
All reactions