We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5086363 commit db11db6Copy full SHA for db11db6
src/runtime/composables/usePortal.ts
@@ -6,11 +6,11 @@ export function usePortal(portal: Ref<string | HTMLElement | boolean | undefined
6
const portalTarget = inject(portalTargetInjectionKey, undefined)
7
8
const to = computed(() => {
9
- if (typeof portal.value === 'string' || portal.value instanceof HTMLElement) {
10
- return portal.value
+ if (typeof portal.value === 'boolean' || portal.value === undefined) {
+ return portalTarget?.value ?? 'body'
11
}
12
13
- return portalTarget?.value ?? 'body'
+ return portal.value
14
})
15
16
const disabled = computed(() => typeof portal.value === 'boolean' ? !portal.value : false)
0 commit comments