Add keyed blocks to enhance MangaPage reactivity

Keyed blocks improve DOM update handling. This improves compatibility with some language learning extensions. For example, this prevents Migaku from persisting textboxes from previous pages as one pages through their comics.
This commit is contained in:
Gnathonic
2025-01-24 18:19:35 -07:00
parent 52619b1a9b
commit bc5b9ccd16

View File

@@ -345,10 +345,12 @@
role="none" role="none"
id="manga-panel" id="manga-panel"
> >
{#if showSecondPage()} {#key page}
<MangaPage page={pages[index + 1]} src={Object.values(volume?.files)[index + 1]} /> {#if showSecondPage()}
{/if} <MangaPage page={pages[index + 1]} src={Object.values(volume?.files)[index + 1]} />
<MangaPage page={pages[index]} src={Object.values(volume?.files)[index]} /> {/if}
<MangaPage page={pages[index]} src={Object.values(volume?.files)[index]} />
{/key}
</div> </div>
</Panzoom> </Panzoom>
</div> </div>