andreknieriem / simplelightbox

Touch-friendly image lightbox for mobile and desktop
https://simplelightbox.js.org
MIT License
1.11k stars 173 forks source link

Issue with activated history #324

Closed SmokinB closed 10 months ago

SmokinB commented 11 months ago

If there is an anchor in the URL from history (for example #pid=1) and I perform a hard page reload (CMD+r), open the lightbox and close it again, an error is thrown on close:

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

andreknieriem commented 11 months ago

Hi, which browser you are using? Cannot reproduce this on simplelightbox.com

SmokinB commented 11 months ago

Hello (-:

Chrome Version 118.0.5993.88 on MacOs

unfortunately I can't reproduce it on simplelightbox.com either.

This is the console output:

simple-lightbox.min.js:1 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. at i.<anonymous> (https://cdn.jsdelivr.net/npm/simplelightbox@2.14.1/dist/simple-lightbox.min.js:1:12633) at t (https://cdn.jsdelivr.net/npm/simplelightbox@2.14.1/dist/simple-lightbox.min.js:1:44131) (anonymous) @ simple-lightbox.min.js:1 t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 requestAnimationFrame (async) t @ simple-lightbox.min.js:1 value @ simple-lightbox.min.js:1 value @ simple-lightbox.min.js:1 (anonymous) @ simple-lightbox.min.js:1

Mtillmann commented 11 months ago

please create a demo of the issue. It is very probable that there's an issue in your markup, unrelated to simplelightbox