Comparing version 8.2.21 to 8.2.22
{ | ||
"name": "hybrids", | ||
"version": "8.2.21", | ||
"version": "8.2.22", | ||
"description": "A JavaScript framework for creating fully-featured web applications, components libraries, and single web components with unique declarative and functional architecture", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -22,4 +22,8 @@ import * as cache from "./cache.js"; | ||
const focusMap = new WeakMap(); | ||
function saveLayout(target) { | ||
function saveLayout() { | ||
const target = stacks.get(rootRouter)[0]; | ||
if (!target) return; | ||
const focusEl = globalThis.document.activeElement; | ||
focusMap.set(target, rootRouter.contains(focusEl) && focusEl); | ||
@@ -289,3 +293,5 @@ | ||
const goBackOnEscKey = (event) => { | ||
if (event.key === "Escape") { | ||
const stack = stacks.get(root); | ||
if (stack[0] === host && event.key === "Escape") { | ||
event.stopPropagation(); | ||
@@ -962,2 +968,3 @@ globalThis.history.go(-1); | ||
} else { | ||
saveLayout(); | ||
replace(); | ||
@@ -982,4 +989,3 @@ } | ||
} else { | ||
let stack = stacks.get(host); | ||
saveLayout(stack[0]); | ||
saveLayout(); | ||
@@ -986,0 +992,0 @@ globalThis.history.scrollRestoration = "manual"; |
206746
6554