mirror of
https://github.com/suitenumerique/drive.git
synced 2026-04-25 17:15:19 +02:00
🐛(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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user