francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.58k stars 160 forks source link

Zooms aren't removed from dom on close event #166

Open hannahmumma-zz opened 3 years ago

hannahmumma-zz commented 3 years ago

Bug description

A clear and concise description of what the bug is. I have two triggers I'm using for multiple zooms. The first is on the image itself and the second is on an open button. When I open and close the zoom on the zoom image click everything is fine. When I open and close the zoom on the open/close button everything appears to be fine. But as I go back to triggering the zoom on zoom image click, all the other zooms I opened with the open button click are there in the dom.

How to reproduce

A list of the steps to reproduce the bug.

  1. Run mediumZoom(selector, options)
  2. Click on the image
  3. See error

Expected behavior

Zooms to be completely cleared out after each zoom.close() call.

Reproducible example

Link to the bug reproduction

Environment