mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 07:46:37 +00:00
use first composePath target
This commit is contained in:
parent
96b9d25bc5
commit
70532ac3bf
@ -9,11 +9,7 @@ export const PreventUnsavedMixin = <T extends Constructor<LitElement>>(
|
||||
class extends superClass {
|
||||
private _handleClick = async (e: MouseEvent) => {
|
||||
// get the right target, otherwise the composedPath would return <home-assistant> 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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user