tweak
This commit is contained in:
@@ -99,6 +99,7 @@ const PreviewZoomOverlay = ({
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || !isNativeScale) {
|
||||
return;
|
||||
@@ -148,6 +149,19 @@ const PreviewZoomOverlay = ({
|
||||
|
||||
const activeDisplay = open && display?.url ? display : displaySnapshot;
|
||||
|
||||
useEffect(() => {
|
||||
if (!activeDisplay?.url) {
|
||||
return;
|
||||
}
|
||||
|
||||
const scrollEl = scrollRef.current;
|
||||
if (scrollEl) {
|
||||
scrollEl.scrollLeft = 0;
|
||||
scrollEl.scrollTop = 0;
|
||||
}
|
||||
focusRef.current = null;
|
||||
}, [activeDisplay?.url]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!renderBackdrop || !activeDisplay?.url) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user