Experiment remove background preview image when image loaded

This commit is contained in:
Lim Chee Aun 2023-03-15 19:28:38 +08:00
parent eb4b22a265
commit 5bb8b3ce29

View file

@ -79,6 +79,10 @@ function Media({ media, showOriginal, autoAnimate, onClick = () => {} }) {
// Open original image in new tab
window.open(url, '_blank');
}}
onLoad={(e) => {
// Hide background image after image loads
e.target.parentElement.style.backgroundImage = 'none';
}}
/>
</div>
);