🐛(frontend) fix image flash when navigating previews

Add a key prop to force React to remount the img element
when switching files. Without this, transitioning between
images of very different sizes causes a visual splash.
This commit is contained in:
Nathan Vasse
2026-04-17 15:01:32 +02:00
parent 26418bda18
commit 77174705ea

View File

@@ -152,6 +152,8 @@ export const FilePreview = ({
src={currentFile.url_preview}
alt={currentFile.title}
className="file-preview__viewer"
// This is made to avoid splash effect when switching between images having a huge size difference.
key={currentFile.id}
/>
);
case MimeCategory.VIDEO: