From ec49f086f048d34f9710f7d60b17c022a2207350 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 6 Dec 2024 12:44:53 +0100 Subject: [PATCH] use first composePath target --- src/mixins/prevent-unsaved-mixin.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mixins/prevent-unsaved-mixin.ts b/src/mixins/prevent-unsaved-mixin.ts index 8f997ce5f9d7..7974d3f940b7 100644 --- a/src/mixins/prevent-unsaved-mixin.ts +++ b/src/mixins/prevent-unsaved-mixin.ts @@ -9,11 +9,7 @@ export const PreventUnsavedMixin = >( class extends superClass { private _handleClick = async (e: MouseEvent) => { // get the right target, otherwise the composedPath would return in the new event - const target = e - .composedPath() - .find( - (n) => (n as HTMLElement).tagName === "HA-SVG-ICON" - ) as HTMLAnchorElement; + const target = e.composedPath()[0]; if (!isNavigationClick(e)) { return; }