Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 75d9648

Browse files
fix: reorder and cache fixed with slide unique key identificator
1 parent fc63ee0 commit 75d9648

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

studio/src/app/handlers/editor/events/deck/deck-events.handler.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ export class DeckEventsHandler {
229229
if (persistedSlide && persistedSlide.id) {
230230
slide.setAttribute('slide_id', persistedSlide.id);
231231

232+
// Add a key to uniquely identify the slide. Mandatory notably for the reorder function
233+
// See https://stenciljs.com/docs/templating-jsx?#loops
234+
slide.setAttribute('key', persistedSlide.id);
235+
232236
this.busyService.slideEditable(slide);
233237
}
234238

studio/src/app/utils/editor/parse-slides.utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class ParseSlidesUtils {
5454
const SlideElement: string = slideTag;
5555

5656
// @ts-ignore
57-
const result: any = <SlideElement slide_id={slide.id} style={style} src={src} custom-background={customBackground} img-src={imgSrc} img-alt={imgAlt}>
57+
const result: any = <SlideElement key={slide.id} slide_id={slide.id} style={style} src={src} custom-background={customBackground} img-src={imgSrc} img-alt={imgAlt}>
5858
{content}
5959
</SlideElement>;
6060

0 commit comments

Comments
 (0)