Bug: Multiple ProseMirror editors on same svelte component do not save properly
Simple reproduction in a foundry world with at least one actor defined:
<svelte:options accessors={true} /><script> import { ApplicationShell } from "#runtime/svelte/component/core"; import { TJSDocument } from "#runtime/svelte/store/fvtt/document"; import { TJSProseMirror } from "#standard/component"; export let elementRoot; let actor = new TJSDocument(game.actors.contents[0]); let base_options = { document: $actor, fieldName: "name", collaborate: true, button: false, editable: true, initialSelection: "start", };</script><ApplicationShell bind:elementRoot> <main> <h1>Basic application</h1> <span>{$actor.name}</span> <TJSProseMirror options={base_options} /> <TJSProseMirror options={base_options} /> </main></ApplicationShell><style lang="scss"> main { text-align: center; display: flex; flex-direction: column; }</style>
<svelte:options accessors={true} /><script> import { ApplicationShell } from "#runtime/svelte/component/core"; import { TJSDocument } from "#runtime/svelte/store/fvtt/document"; import { TJSProseMirror } from "#standard/component"; export let elementRoot; let actor = new TJSDocument(game.actors.contents[0]); let base_options = { document: $actor, fieldName: "name", collaborate: true, button: false, editable: true, initialSelection: "start", };</script><ApplicationShell bind:elementRoot> <main> <h1>Basic application</h1> <span>{$actor.name}</span> <TJSProseMirror options={base_options} /> <TJSProseMirror options={base_options} /> </main></ApplicationShell><style lang="scss"> main { text-align: center; display: flex; flex-direction: column; }</style>
The top editor save button will do nothing. In general, it seems like only the last editor's save button actually works. When the components are unmounted, save works normally. This issue persists even if the editors are targeting different fieldNames.
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community