react-medium-image-zoom: styles for zoomImage prop don't work

Expected behavior

I expected style key to work with the zoomImage prop.

e.g.

zoomImage={{
    src: `${item.imageS}`,
    style: {width: `20rem`, height: `5rem`}
}}

…makes the zoomed image 20rem wide, 5rem tall. Changing styles works perfectly for the image prop.

Actual behavior

Adding style key the zoomImage prop object has no effect.

e.g.

zoomImage={{
    src: `${item.imageS}`,
    style: {width: `20rem`, height: `5rem`}
}}

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

@13806 @deadcoder0904 @xerona I’ve added you all to the “all contributors” section as a thank you for your 👀 and 💭 here. image

This should not be an issue in the latest react-medium-image-zoom@alpha v4 release channel, for we don’t exactly have a zoomImage prop to work with in the new API (though I’ll try to figure out how/if I want to achieve something similar in https://github.com/rpearce/react-medium-image-zoom/issues/166).

Closing this

@deadcoder0904 THANK YOU for the repro

Okay, this and that PR are going on my to-do list. I don’t have time to look at this during the work day, unfortunately. I’ll check back in the next couple of days