Set image.loading to eager to fix safari/viewerjs bug
This commit is contained in:
parent
33ca9f0c03
commit
d8f3904760
@ -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');
|
||||
|
||||
@ -35,7 +35,6 @@ export default function PhotosLarge({
|
||||
onVisible={index === photos.length - 1
|
||||
? onLastPhotoVisible
|
||||
: undefined}
|
||||
showZoomControls={false}
|
||||
/>)}
|
||||
itemKeys={photos.map(photo => photo.id)}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user