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; }