Lightgallery: Error when closing gallery

Created on 24 Dec 2018  路  17Comments  路  Source: sachinchoolur/lightGallery

In Chrome 71, exception is thrown when invoking document.exitFullscreen() while not in full-screen mode.
https://github.com/jpilfold/ngx-image-viewer/issues/23#issuecomment-446899261

Most helpful comment

I have fixed this issue by editing the lightgallery-all.js file changing line 1645
From : if (document.exitFullscreen) {
To: if (document.fullscreenElement) {

All 17 comments

I can confirm. Exact same bug.

Will fix it locally with one of the mentioned workarounds.

Same here. Any plans to fix this? :)

@sachinchoolur It looks like https://github.com/jpilfold/ngx-image-viewer/issues/23 had some potential fixes for this issue.

Same here.

Same here

I get this error sent to the DOM when closing the full screen view in Chrome

Uncaught (in promise) TypeError: Document not active
at Fullscreen.exitFullscreen
(lg-fullscreen.js:75)
at Fullscreen.destroy (lg-fullscreen.js:107)
at Function. (lightgallery.js:1311)
at Function.each (jquery-3.1.1.min.js:2)
at Plugin.destroy (lightgallery.js:1309)
at HTMLSpanElement. (lightgallery.js:1244)
at HTMLSpanElement.dispatch (jquery-3.1.1.min.js:3)
at HTMLSpanElement.q.handle (jquery-3.1.1.min.js:3)

Using your demo link [http://sachinchoolur.github.io/lightGallery/]
screen

I have fixed this issue by editing the lightgallery-all.js file changing line 1645
From : if (document.exitFullscreen) {
To: if (document.fullscreenElement) {

Fixing this problem in source files seems not to be the right solution

Same here.

If someone can create a PR with the fix; this can most likely get fixed a lot sooner.

Same here

+1

Guys, Really sorry for the delayed response. The issue has been fixed.

Guys, Really sorry for the delayed response. The issue has been fixed.

Do not forget to add lib to NPM

screen shot 2019-02-19 at 5 26 01 pm

+1

It seems like the error still occurs if we use the all.min.js from dist/js.

You can open the all.min.js and search for prototype.exitFullscreen=function
and then change the {document.exitFullscreen?
to {document.fullscreenElement?

That fixes it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrew--r picture andrew--r  路  3Comments

preliot picture preliot  路  3Comments

FDiskas picture FDiskas  路  5Comments

aitormendez picture aitormendez  路  4Comments

HamzaAbdullahMoh picture HamzaAbdullahMoh  路  4Comments