-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Components: Modal: Wrap the modal contents in a StyleProvider #36261
Conversation
> | ||
{ title } | ||
</h1> | ||
<StyleProvider document={ document }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love confirmation from @ciampo or @sarayourfriend I think the fix is correct but would love another opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I think this is correct. Previously we had an internal Portal
component that implemented something like this in the early days of trying to migrate the G2 style system.
I think we just forgot this edge case when adding the StyleProvider back to the app.
Size Change: +17 B (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
This ensures that any content inside a modal has the correct styles applied by emotion. Fixes #33735.
a2dfa1a
to
944cf66
Compare
This ensures that any content inside a modal has the correct styles applied by emotion. Fixes #33735.
Cherry-picked into the GB 11.9 release in 43a1769 |
This ensures that any content inside a modal has the correct styles applied by emotion. Previously, any components using emotion styles in the modal content were not rendered correctly. The components are given a unique prefix ID (cache key), but no styles were registered to that UUID key. @youknowriad suggested that the Modal's portal needs
StyleProvider
. I've added that, and now the emotion styles are being generated for modal content.Fixes #33735.
How has this been tested?
Manually tested using my test case plugin, the styles inside the modal were missing before the patch, but are loaded correctly now.
Screenshots
The issue was in the Site Editor (or any other iframed editor), so I added my test plugin into the Site Editor. It adds a button to open a modal with some components that use emotion styles.
Before, no grid and an invisible spinner.
After, grid layout with a spinner
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).