From a2dfa1a151c72493e812c387b383470e5036b2ed Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Fri, 5 Nov 2021 10:55:24 -0400 Subject: [PATCH] Components: Modal: Wrap the modal contents in a StyleProvider This ensures that any content inside a modal has the correct styles applied by emotion. Fixes #33735. --- packages/components/src/modal/index.js | 101 ++++++++++++++----------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/packages/components/src/modal/index.js b/packages/components/src/modal/index.js index fe57b88409c94b..b846accc139c81 100644 --- a/packages/components/src/modal/index.js +++ b/packages/components/src/modal/index.js @@ -25,6 +25,7 @@ import { closeSmall } from '@wordpress/icons'; */ import * as ariaHelper from './aria-helper'; import Button from '../button'; +import StyleProvider from '../style-provider'; // Used to count the number of open modals. let openModalCount = 0; @@ -111,55 +112,65 @@ export default function Modal( { ) } onKeyDown={ handleEscapeKeyDown } > -
-
-
-
- { icon && ( - - { icon } - - ) } - { title && ( -

- { title } -

+ +
+
+
+
+ { icon && ( + + { icon } + + ) } + { title && ( +

+ { title } +

+ ) } +
+ { isDismissible && ( +
- { isDismissible && ( -
- { children }
-
+
, document.body );