File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ const getModalRoot: ModalProps['getModalRoot'] = async () => {
1313} ;
1414
1515const removeModalRoot : ModalProps [ 'removeModalRoot' ] = root => {
16- document . body . removeChild ( root ) ;
16+ if ( root ) {
17+ document . body . removeChild ( root ) ;
18+ }
1719} ;
1820
1921export default function ( ) {
Original file line number Diff line number Diff line change 9898 } )
9999) ;
100100
101- ( process . env . REACT_VERSION !== '18' ? test : test . skip ) (
101+ test (
102102 'renders modal in async root' ,
103103 useBrowser ( async browser => {
104104 const page = new BasePageObject ( browser ) ;
Original file line number Diff line number Diff line change 22// SPDX-License-Identifier: Apache-2.0
33import React from 'react' ;
44
5+ import { PortalProps } from '@cloudscape-design/component-toolkit/internal' ;
6+
57import { FlowType } from '../internal/analytics/interfaces' ;
68import { BaseComponentProps } from '../internal/base-component' ;
79import { NonCancelableEventHandler } from '../internal/events' ;
@@ -11,14 +13,14 @@ export interface BaseModalProps {
1113 * Use this property to specify a different dynamic modal root for the dialog.
1214 * The function will be called when a user clicks on the trigger button.
1315 */
14- getModalRoot ?: ( ) => Promise < HTMLElement > ;
16+ getModalRoot ?: PortalProps [ 'getContainer' ] ;
1517
1618 /**
1719 * Use this property when `getModalRoot` is used to clean up the modal root
1820 * element after a user closes the dialog. The function receives the return value
1921 * of the most recent getModalRoot call as an argument.
2022 */
21- removeModalRoot ?: ( rootElement : HTMLElement ) => void ;
23+ removeModalRoot ?: PortalProps [ 'removeContainer' ] ;
2224}
2325
2426export interface ModalProps extends BaseComponentProps , BaseModalProps {
You can’t perform that action at this time.
0 commit comments