Skip to content

Commit b68ba07

Browse files
committed
fix portal issue with nested popover/menu
1 parent 4e25055 commit b68ba07

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/react-components/react-portal/library/src/components/Portal/usePortalMountNode.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,13 @@ const useModernElementFactory: UseElementFactory = options => {
163163

164164
set(_, property: keyof HTMLDivElement | '_virtual' | 'focusVisible', value) {
165165
const ignoredProperty = property === '_virtual' || property === 'focusVisible';
166+
const targetElement = elementFactory.get(targetNode, false);
166167

167-
if (ignoredProperty) {
168+
if (ignoredProperty && !targetElement) {
168169
// We ignore the `_virtual` and `focusVisible` properties to avoid conflicts with the proxy
169170
return true;
170171
}
171172

172-
const targetElement = elementFactory.get(targetNode, ignoredProperty);
173-
174173
if (targetElement) {
175174
Object.assign(targetElement, { [property]: value });
176175
return true;

0 commit comments

Comments
 (0)