feat(angular, react, vue): add support for autoMountComponent (#25552)

This commit is contained in:
Liam DeBeasi
2022-07-05 12:57:16 -04:00
committed by GitHub
parent 0eaacdaf75
commit 805dfa0566
28 changed files with 448 additions and 13 deletions

View File

@ -21,6 +21,7 @@ interface IonicReactInternalProps<ElementType> extends React.HTMLAttributes<Elem
onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
keepContentsMounted?: boolean;
}
export const createInlineOverlayComponent = <PropType, ElementType>(
@ -128,7 +129,7 @@ export const createInlineOverlayComponent = <PropType, ElementType>(
* so conditionally render the component
* based on the isOpen state.
*/
return createElement(tagName, newProps, (this.state.isOpen) ?
return createElement(tagName, newProps, (this.state.isOpen || this.props.keepContentsMounted) ?
createElement('div', {
id: 'ion-react-wrapper',
ref: this.wrapperRef,