This commit is contained in:
seb
2026-10-11 15:01:26 +02:00
parent 95523ce9f3
commit a96a80a036

View File

@@ -1,6 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react';
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import IconButton from '@mui/material/IconButton'; import IconButton from '@mui/material/IconButton';
import Portal from '@mui/material/Portal';
import MapRoundedIcon from '@mui/icons-material/MapRounded'; import MapRoundedIcon from '@mui/icons-material/MapRounded';
import CloseRoundedIcon from '@mui/icons-material/CloseRounded'; import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
@@ -202,6 +203,7 @@ export default function PageMinimap({ sourceSelector = 'main' }) {
// Collapsed: a single centered pill to reopen the overview. // Collapsed: a single centered pill to reopen the overview.
if (!open) { if (!open) {
return ( return (
<Portal>
<Box <Box
sx={{ sx={{
position: 'fixed', position: 'fixed',
@@ -231,10 +233,12 @@ export default function PageMinimap({ sourceSelector = 'main' }) {
<MapRoundedIcon fontSize="small" /> <MapRoundedIcon fontSize="small" />
</IconButton> </IconButton>
</Box> </Box>
</Portal>
); );
} }
return ( return (
<Portal>
<Box <Box
sx={{ sx={{
position: 'fixed', position: 'fixed',
@@ -366,5 +370,6 @@ export default function PageMinimap({ sourceSelector = 'main' }) {
</Box> </Box>
</Box> </Box>
</Box> </Box>
); </Portal>
);
} }