Small fixes

This commit is contained in:
Andras Schmelczer 2026-03-28 09:29:56 +00:00
parent d93beb9201
commit 7591e5fc05
12 changed files with 198 additions and 14 deletions

View file

@ -338,6 +338,18 @@ export default function MapPage({
return () => document.removeEventListener('wheel', handleWheel);
}, []);
// On mobile, push a guard history entry to absorb accidental back navigations
// (e.g. iOS Safari edge-swipe that CSS touch-action can't prevent)
useEffect(() => {
if (!isMobile) return;
window.history.pushState({ dashboardGuard: true }, '');
const handlePopState = () => {
window.history.pushState({ dashboardGuard: true }, '');
};
window.addEventListener('popstate', handlePopState);
return () => window.removeEventListener('popstate', handlePopState);
}, [isMobile]);
const { handleHexagonClick } = selection;
const handleMobileHexagonClick = useCallback(
(id: string, isPostcode?: boolean, geometry?: PostcodeGeometry) => {
@ -611,7 +623,7 @@ export default function MapPage({
if (isMobile) {
return (
<div className="flex-1 flex flex-col overflow-hidden relative">
<div className="flex-1 flex flex-col overflow-hidden relative touch-pan-y">
{initialLoading && (
<div className="absolute inset-0 z-50 flex items-center justify-center bg-warm-50/80 dark:bg-navy-950/80 backdrop-blur-sm">
<div className="flex flex-col items-center gap-4">