diff --git a/src/router/router.js b/src/router/router.js index e097417c..c77a29e7 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -22,6 +22,7 @@ import { Log } from '../lib/log.js' import { stage } from '../launch.js' import Focus from '../focus.js' import Announcer from '../announcer/announcer.js' +import eventListeners from '../lib/eventListeners.js' export let currentRoute export let navigating = false @@ -143,6 +144,11 @@ export const navigate = async function () { route.transition = route.transition(previousRoute, route) } + // remove event listeners from current active view + if (previousRoute) { + eventListeners.removeListeners(this.activeView) + } + let holder let { view, focus } = cacheMap.get(route) || {}