From b49fc3205d54471ac4c5415423221b7e793ff576 Mon Sep 17 00:00:00 2001 From: binrysearch Date: Tue, 10 Sep 2024 09:54:32 +0100 Subject: [PATCH] do not recreate root twice in tour --- src/packages/tour/tour.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/packages/tour/tour.ts b/src/packages/tour/tour.ts index ae27fb995..d1b6f1d76 100644 --- a/src/packages/tour/tour.ts +++ b/src/packages/tour/tour.ts @@ -423,8 +423,10 @@ export class Tour implements Package { * Create the root element for the tour */ private createRoot() { - this._root = TourRoot({ tour: this }); - dom.add(this.getTargetElement(), this._root); + if (!this._root) { + this._root = TourRoot({ tour: this }); + dom.add(this.getTargetElement(), this._root); + } } /** @@ -433,6 +435,7 @@ export class Tour implements Package { private recreateRoot() { if (this._root) { this._root.remove(); + this._root = undefined; this.createRoot(); } }