diff --git a/src/entrypoints/custom-panel.js b/src/entrypoints/custom-panel.js index 4ce6e012b4..ea3c84b481 100644 --- a/src/entrypoints/custom-panel.js +++ b/src/entrypoints/custom-panel.js @@ -56,7 +56,7 @@ function initialize(panel, properties) { const forwardEvent = (ev) => window.parent.customPanel.fire(ev.type, ev.detail); root.addEventListener("hass-toggle-menu", forwardEvent); - root.addEventListener("location-changed", () => + window.addEventListener("location-changed", () => window.parent.customPanel.navigate(window.location.pathname) ); setProperties(Object.assign({ panel }, properties));