Giter Site home page Giter Site logo

Comments (4)

dweber019 avatar dweber019 commented on June 10, 2024

@khanhvu161188 in my case this worked
window.lgData[document.getElementById('lightgallery').getAttribute('lg-uid')].destroy(true);

passing true to destroy method.

from lg-thumbnail.js.

sachinchoolur avatar sachinchoolur commented on June 10, 2024

The issue has been fixed. Please use the latest version of lightgallery.js and lg-thumbnail.js

from lg-thumbnail.js.

erkage avatar erkage commented on June 10, 2024

What if i have this issue with the latest versions?
My code where it occurs:

let lg = document.getElementById("lightGallery");
lg.addEventListener('onSlideClick', function () {
	window.lgData[lg.getAttribute('lg-uid')].destroy();
}, false);

lg.addEventListener('onCloseAfter', function () {
	if (lg.getAttribute('lg-uid'))
		window.lgData[lg.getAttribute('lg-uid')].destroy(true);
}, false);

window.lightGallery(lg, {
	index: imageIndex,
	hideBarsDelay: 20000,
	preload: 3,
	speed: 0,
	//enableDrag: false,
	dynamic: true,
	dynamicEl: this.imgs(),
	thumbnail:true,
});

And getting the following error:

Uncaught TypeError: Cannot read property 'removeChild' of null
    at Thumbnail.destroy (lg-thumbnail.js?5fcc:478)
    at Plugin.destroy (lightgallery.js?4689:1364)
    at HTMLDivElement.eval (ModelCard.vue?f04d:135)
    at Object.trigger (lg-utils.js?c7c8:96)
    at eval (lightgallery.js?4689:1238)

from lg-thumbnail.js.

h3 avatar h3 commented on June 10, 2024

I confirm this issue is still occurring with latest version (1.2.0).

Here's the affected browsers I got:

  • Chrome Mobile 86.0.4240 / 88.0.4324
  • Chrome 87.0.4280 / 88.0.4324
  • Edge 88.0.705
  • Opera Mobile 61.2.3076
  • Samsung Internet 13.2

from lg-thumbnail.js.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.