Skip to content

Commit e6c6dd9

Browse files
committed
fix: 🐛 canvas is not cleaning up when switching slides
When using DeckBuilder and adding slides via withSlide() methods there, it creates each slide with its own canvas representation. It leads to the problem, when deck is not able to clean up canvas when switching slides back and forth. This commit fixes an issue by passing the right canvas from Deck instance through SlideBuilder.withCanvas() method.
1 parent ece0538 commit e6c6dd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/kittik-deck/src/DeckBuilder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class DeckBuilder<TShape extends string, TAnimation extends string> {
2828
}
2929

3030
public withSlide (fn: (builder: SlideBuilder<TShape, TAnimation>) => Slide): this {
31-
const builder = SlideBuilder.start(this.shapes, this.animations);
31+
const builder = SlideBuilder.start(this.shapes, this.animations).withCanvas(this.deck.canvas);
3232
const slide = fn(builder);
3333

3434
this.deck.addSlide(slide);

0 commit comments

Comments
 (0)