@stubber/form-fields 2.0.14 → 2.0.16
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
export const select_field_param_spec = {
|
|
1
|
+
<script context="module">export const select_field_param_spec = {
|
|
3
2
|
spec: {
|
|
4
3
|
fields: {
|
|
5
4
|
options: {
|
|
@@ -95,10 +94,18 @@ const handle_select = (item_key, trigger) => {
|
|
|
95
94
|
}
|
|
96
95
|
closeAndFocusTrigger(trigger);
|
|
97
96
|
};
|
|
97
|
+
let triggerEl;
|
|
98
|
+
let portalTarget = document.body;
|
|
99
|
+
$: if (triggerEl && !portalTarget) {
|
|
100
|
+
const root = triggerEl.getRootNode();
|
|
101
|
+
portalTarget = root instanceof ShadowRoot ? root.host : document.body;
|
|
102
|
+
}
|
|
98
103
|
</script>
|
|
99
104
|
|
|
105
|
+
<div class="invisible hidden" bind:this={triggerEl} />
|
|
106
|
+
|
|
100
107
|
<FieldLabel {fieldStore} />
|
|
101
|
-
<Popover.Root bind:open let:ids>
|
|
108
|
+
<Popover.Root bind:open let:ids portal={portalTarget}>
|
|
102
109
|
<Popover.Trigger asChild let:builder>
|
|
103
110
|
<Button
|
|
104
111
|
builders={[builder]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import {
|
|
2
|
+
import type { Writable } from "svelte/store";
|
|
3
3
|
import type { IBaseField, IBuiltField, IInitialForm } from "../interfaces";
|
|
4
4
|
export interface ISelectFieldOption {
|
|
5
5
|
label: string;
|