react-image-magnify
react-image-magnify copied to clipboard
Small image width and height attributes missing
To avoid Cumulative Layout Shift, I would like width and height attributes set on the small img. Makes sense to me to use the existing width and height options.
I imagine it would be something along the lines of
...
width: smallImg.width,
height: smallImg.height
...
here: https://github.com/ethanselzer/react-image-magnify/blob/master/src/ReactImageMagnify.js#L331-L341
Hi @matthewlein I've forked the project and added support here: https://www.npmjs.com/package/@blacklab/react-image-magnify
As a note, I'm still working through some bugs that resulted in the rewrite. If you use this library and encounter any, please report them as issues in my github repo so I can address them.
Thanks!