flexanalytics / plugin-image-zoom

MIT License
67 stars 13 forks source link

zoom failed at docusaurus version 2.0.0-beta.18 #11

Closed qileq closed 2 years ago

qileq commented 2 years ago

When I click the image, I get a error message in Chrome console: image

Then I check the image html code: image

It's seems like refactor: extract MDX components #6989 modify image class name, then image zoom plugin failed.

ataft commented 2 years ago

This looks like an issue with either docusaurus or medium-zoom. The plugin-image-zoom plugin is just passing the selector and options to mediumZoom: https://github.com/flexanalytics/plugin-image-zoom/blob/master/src/zoom.js#L31

Perhaps debug what it's passing, and then what's going on in medium-zoom. I believe the error is from this line: https://github.com/francoischalifour/medium-zoom/blob/master/src/medium-zoom.js#L326

ntolia commented 2 years ago

Ran into the same problem with Docusaurus 2.0.1. I discovered that if I remove the following medium-zoom options, the error does not occur.

          container: '#zoom-container',
          template: '#zoom-template',
qileq commented 2 years ago

Ran into the same problem with Docusaurus 2.0.1. I discovered that if I remove the following medium-zoom options, the error does not occur.

          container: '#zoom-container',
          template: '#zoom-template',

Yes, I'm success too, thank you very much! @ntolia