Merge pull request #176 from sambecker/safari-zoom-fix

Mitigate Safari/`viewerjs` zoom bug
This commit is contained in:
Sam Becker 2025-01-29 23:17:55 -06:00 committed by GitHub
commit 9a01a877a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -20,8 +20,6 @@ export default function useImageZoomControls(
useEffect(() => {
if (imageRef.current && isEnabled) {
viewerRef.current = new Viewer(imageRef.current, {
inline: false,
button: true,
navbar: false,
title: false,
toolbar: {
@ -29,6 +27,10 @@ export default function useImageZoomControls(
reset: 2,
zoomOut: 3,
},
url: (image: HTMLImageElement) => {
image.loading = 'eager';
return image.src;
},
show: () => {
setShouldRespondToKeyboardCommands?.(false);
setColorLight('#000');

View File

@ -35,7 +35,6 @@ export default function PhotosLarge({
onVisible={index === photos.length - 1
? onLastPhotoVisible
: undefined}
showZoomControls={false}
/>)}
itemKeys={photos.map(photo => photo.id)}
/>