Skip to content

Commit 101f519

Browse files
committed
for now remove auto-collapsing to avoid problem when switching profiles, regarding #447
1 parent f44e4ca commit 101f519

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/App.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ function SmallScreenLayout({
376376
const hasPath = route.selectedPath.points.coordinates.length > 0
377377
const settings = useContext(SettingsContext)
378378

379-
const isShortScreen = useMediaQuery({ query: '(max-height: 40rem)' })
380379
const [isFooterCollapsed, setIsFooterCollapsed] = useState(false)
381380
const footerRef = useRef<HTMLDivElement>(null)
382381

@@ -385,20 +384,6 @@ function SmallScreenLayout({
385384
if (hasPath) setIsFooterCollapsed(false)
386385
}, [route.routingResult.paths])
387386

388-
// Auto-collapse on map interaction (only on short screens)
389-
useEffect(() => {
390-
if (!isShortScreen) return
391-
const handleClick = (e: Event) => {
392-
if (!(e.target instanceof Node && footerRef.current?.contains(e.target)) && hasPath)
393-
setIsFooterCollapsed(true)
394-
}
395-
window.addEventListener('mousedown', handleClick)
396-
window.addEventListener('touchstart', handleClick)
397-
return () => {
398-
window.removeEventListener('mousedown', handleClick)
399-
window.removeEventListener('touchstart', handleClick)
400-
}
401-
})
402387

403388
return (
404389
<>

0 commit comments

Comments
 (0)