···222222 // Strip query parameters for route matching (but keep full path for caching)
223223 const pathname = path.split("?")[0];
224224 if (this.currentPage) {
225225+ // Safari can keep processing a focused search control after its page is
226226+ // hidden. Release focus before moving the page into the route cache.
227227+ const activeElement = document.activeElement;
228228+ if (activeElement && this.currentPage.contains(activeElement)) {
229229+ activeElement.blur();
230230+ }
225231 this.currentPage.dispatchEvent(new CustomEvent("page-exit"));
226232 this.currentPage.classList.remove("page-visible");
227233 this.currentPage.classList.add("page-hidden");