When I change the value of one select, the other only updates if I close and re-open the item sheet.
The parent component of the two partials is
ItemSheetShell.svelte
ItemSheetShell.svelte
:
<svelte:options accessors={true} /><script> import { ApplicationShell } from "@typhonjs-fvtt/runtime/svelte/component/core"; import { setContext, getContext } from "svelte"; import SpellHeader from "~/components/item/type/spell/SpellHeader.svelte"; import SpellTabs from "~/components/item/type/spell/SpellTabs.svelte"; export let elementRoot; //- passed in by SvelteApplication export let documentStore; //- passed in by DocumentSheet.js where it attaches DocumentShell to the DOM body export let document; //- passed in by DocumentSheet.js where it attaches DocumentShell to the DOM body const tabMap = { spell: SpellTabs, }; const application = getContext("external").application; let activeTab = "description"; setContext("#doc", documentStore); $: item = $documentStore;</script><template lang="pug"> svelte:component(this="{headerMap[item.type]}") svelte:component(this="{tabMap[item.type]}")</template>
<svelte:options accessors={true} /><script> import { ApplicationShell } from "@typhonjs-fvtt/runtime/svelte/component/core"; import { setContext, getContext } from "svelte"; import SpellHeader from "~/components/item/type/spell/SpellHeader.svelte"; import SpellTabs from "~/components/item/type/spell/SpellTabs.svelte"; export let elementRoot; //- passed in by SvelteApplication export let documentStore; //- passed in by DocumentSheet.js where it attaches DocumentShell to the DOM body export let document; //- passed in by DocumentSheet.js where it attaches DocumentShell to the DOM body const tabMap = { spell: SpellTabs, }; const application = getContext("external").application; let activeTab = "description"; setContext("#doc", documentStore); $: item = $documentStore;</script><template lang="pug"> svelte:component(this="{headerMap[item.type]}") svelte:component(this="{tabMap[item.type]}")</template>
Which sets the context.
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community