Skip to content

Commit 4f6f67c

Browse files
committed
only check if _mainTreeNodeRef is passed in (Vue)
It can be that it is passed in but still `null`, that's fine because it means it will be passed in later once the DOM is ready.
1 parent a3fa86b commit 4f6f67c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/@headlessui-vue/src/hooks/use-root-containers.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ref, h, Ref, computed } from 'vue'
1+
import { ref, h, Ref } from 'vue'
22
import { Hidden, Features as HiddenFeatures } from '../internal/hidden'
33
import { getOwnerDocument } from '../utils/owner'
44
import { dom } from '../utils/dom'
@@ -58,8 +58,7 @@ export function useRootContainers({
5858
},
5959
mainTreeNodeRef,
6060
MainTreeNode() {
61-
let hasPassedInMainTreeNode = (_mainTreeNodeRef?.value ?? null) !== null
62-
if (hasPassedInMainTreeNode) return null
61+
if (_mainTreeNodeRef != null) return null
6362
return h(Hidden, { features: HiddenFeatures.Hidden, ref: mainTreeNodeRef })
6463
},
6564
}

0 commit comments

Comments
 (0)