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

Commit 4939758

Browse files
fix: get deep selected element
1 parent ff26cd9 commit 4939758

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

studio/src/app/pages/editor/app-editor/app-editor.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,19 @@ export class AppEditor {
364364
return;
365365
}
366366

367-
if (!$event.target || !($event.target instanceof HTMLElement)) {
367+
if (!$event.target) {
368368
resolve();
369369
return;
370370
}
371371

372-
const element: HTMLElement = $event.target as HTMLElement;
372+
const targets: EventTarget[] = $event.composedPath();
373+
374+
if (!targets || targets.length <= 0) {
375+
resolve();
376+
return;
377+
}
378+
379+
const element: HTMLElement = targets[0] as HTMLElement;
373380

374381
await this.touchToolbar(element);
375382

0 commit comments

Comments
 (0)