This commit is contained in:
2025-11-14 02:35:17 +01:00
parent 6f4ff68062
commit a3c5494bf7
53 changed files with 269 additions and 340 deletions
+2 -5
View File
@@ -28,7 +28,7 @@ const PreviewZoomOverlay: React.FC<PreviewZoomOverlayProps> = ({
display = null,
onClose = noop,
}) => {
const portalTarget = typeof document !== 'undefined' ? document.body : null;
const portalTarget = document.body;
const [isNativeScale, setIsNativeScale] = useState(false);
const [naturalSize, setNaturalSize] = useState<NaturalSize>({ width: null, height: null });
const [renderBackdrop, setRenderBackdrop] = useState(false);
@@ -135,9 +135,6 @@ const PreviewZoomOverlay: React.FC<PreviewZoomOverlayProps> = ({
}, [open, isNativeScale, naturalSize.width, naturalSize.height]);
useEffect(() => {
if (typeof document === 'undefined') {
return;
}
if (!open) {
previouslyFocusedRef.current?.focus?.();
previouslyFocusedRef.current = null;
@@ -247,7 +244,7 @@ const PreviewZoomOverlay: React.FC<PreviewZoomOverlayProps> = ({
toggleZoomAtPoint(event.clientX ?? 0, event.clientY ?? 0);
};
if (!renderBackdrop || !activeDisplay?.url || !portalTarget) {
if (!renderBackdrop || !activeDisplay?.url) {
return null;
}