Fix lazy loading (Firefox)
see https://bugzilla.mozilla.org/show_bug.cgi?id=1647077 `loading` attribute needs to be before `src` attribute
This commit is contained in:
parent
18661afbc9
commit
4da3376d5f
|
|
@ -13,9 +13,9 @@ export interface PhotoWithFolder extends ImageWithThumbnail {
|
||||||
const PreviewFolder = ({ folder }: { folder: FolderPreview }) => {
|
const PreviewFolder = ({ folder }: { folder: FolderPreview }) => {
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
|
loading="lazy"
|
||||||
src={folder.imagePreview.thumbnail}
|
src={folder.imagePreview.thumbnail}
|
||||||
alt={folder.name}
|
alt={folder.name}
|
||||||
loading="lazy"
|
|
||||||
style={{
|
style={{
|
||||||
objectFit: "cover",
|
objectFit: "cover",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export const ImageGallery = ({ images }: { images: ImageWithThumbnail[] }) => {
|
||||||
photos={images}
|
photos={images}
|
||||||
render={{
|
render={{
|
||||||
image: (props, context) => (
|
image: (props, context) => (
|
||||||
<img {...props} src={context.photo.thumbnail} loading={"lazy"} />
|
<img loading={"lazy"} {...props} src={context.photo.thumbnail} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
onClick={({ index }) => setIndex(index)}
|
onClick={({ index }) => setIndex(index)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue