@stubber/form-fields 2.0.15 → 2.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,7 +27,7 @@ import * as Command from "@stubber/ui/command";
|
|
|
27
27
|
import * as Popover from "@stubber/ui/popover";
|
|
28
28
|
import { createState } from "cmdk-sv";
|
|
29
29
|
import { debounce, isEqual } from "lodash-es";
|
|
30
|
-
import { tick } from "svelte";
|
|
30
|
+
import { onMount, tick } from "svelte";
|
|
31
31
|
import FieldLabel from "../FieldLabel.svelte";
|
|
32
32
|
import FieldMessage from "../FieldMessage.svelte";
|
|
33
33
|
import { clear_value_details, set_value_details } from "../utils";
|
|
@@ -95,17 +95,18 @@ const handle_select = (item_key, trigger) => {
|
|
|
95
95
|
closeAndFocusTrigger(trigger);
|
|
96
96
|
};
|
|
97
97
|
let triggerEl;
|
|
98
|
-
let portalTarget =
|
|
99
|
-
|
|
100
|
-
const root = triggerEl
|
|
98
|
+
let portalTarget = document.body;
|
|
99
|
+
onMount(() => {
|
|
100
|
+
const root = triggerEl?.getRootNode();
|
|
101
101
|
portalTarget = root instanceof ShadowRoot ? root.host : document.body;
|
|
102
|
-
|
|
102
|
+
console.log("portalTarget", portalTarget);
|
|
103
|
+
});
|
|
103
104
|
</script>
|
|
104
105
|
|
|
105
106
|
<div class="invisible hidden" bind:this={triggerEl} />
|
|
106
107
|
|
|
107
108
|
<FieldLabel {fieldStore} />
|
|
108
|
-
<Popover.Root bind:open let:ids>
|
|
109
|
+
<Popover.Root bind:open let:ids portal={portalTarget}>
|
|
109
110
|
<Popover.Trigger asChild let:builder>
|
|
110
111
|
<Button
|
|
111
112
|
builders={[builder]}
|