Open joyfulelement opened 4 years ago
After some more troubleshooting, I later found the issue above can be reproduced if the component is re-mounted. Looks like when the component mounts again, the class medium-zoom-image
does not get apply.
Is there some workaround for this issue?
While testing the responsiveness of this plug-in with gatsby, I noticed the zoom capability will disappear after the browser viewport resolution is changed, e.g. portrait to landscape or vice versa. A common use case when viewing with mobile device.
By examine the DOM, before the viewport size change:
after the browser viewport resolution is changed, the class
medium-zoom-image
that use to be applied against<img>
tag will disappear and hence the loss of the zoom functionality:Current Workaround
While not ideal, the zoom functionality can be restored with another manual refresh after the viewport resolution change.