diff --git a/packages/react/src/components/createInlineOverlayComponent.tsx b/packages/react/src/components/createInlineOverlayComponent.tsx index 65f1711cbb7..6127cc354ca 100644 --- a/packages/react/src/components/createInlineOverlayComponent.tsx +++ b/packages/react/src/components/createInlineOverlayComponent.tsx @@ -199,8 +199,10 @@ export const createInlineOverlayComponent = ( * that removes the item.) */ if (wrapper && el) { + // The delegate's removeViewFromDom call handles unmounting the React component. + // Setting state here can cause race conditions. + // Restore the wrapper to the element before the delegate removes it. el.append(wrapper); - this.setState({ isOpen: false }); } this.props.onDidDismiss && this.props.onDidDismiss(evt);