gabrielcsapo / gabrielcsapo/docusaurus-plugin-image-zoom
Plugin doesn't work properly with @docusaurus/plugin-ideal-image
- Dominant language
- JavaScript
- Stars
- 84
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Hello again!
I have discovered a bug when using this plugin with the [@docusaurus/plugin-ideal-image][ideal-image] plugin.
Initially, the ideal images plugin renders images to the document like this:
```html

```
Then, when the `div` element enters the viewport, it gets mutated to:
```html
```
However, it looks like the replacement image doesn't get passed to a `mediumZoom` function call, meaning that any images that load in as you scroll are not zoomable.
I notice that you're observing attributes to update the background color (presumably for when the user switch between light and dark mode). I also notice that you seem to be waiting for new page loads, so that you can reinitialize the `zoomObject` for any new images.
(Please note, I am not a JavaScript developer, so all of this is just my best guess.)
Do you think it would be possible to fix this issue by observing for subtree mutations on the `article` elements, and then reinitializing the `zoomObject`, like you do with a new page?
[ideal-image]: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-ideal-image
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.