Skip to content

Commit fbbc405

Browse files
authored
fix: event.composePath() throws in Salesforce environment (#390)
1 parent e9459c5 commit fbbc405

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/multiple-select-vanilla/src/MultipleSelectInstance.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,11 @@ export class MultipleSelectInstance {
554554
}
555555

556556
protected getEventTarget(e: Event & { target: HTMLElement }): HTMLElement {
557-
if (e.composedPath) {
558-
return e.composedPath()[0] as HTMLElement;
557+
try {
558+
return (e.composedPath?.()[0] || (e as any).path?.[0] || e.target) as HTMLElement;
559+
} catch {
560+
return e.target as HTMLElement;
559561
}
560-
return e.target as HTMLElement;
561562
}
562563

563564
protected getListRows(): HtmlStruct[] {

0 commit comments

Comments
 (0)