Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: documentLastFocus is null #151

Closed
ktomk opened this issue May 13, 2017 · 7 comments
Closed

TypeError: documentLastFocus is null #151

ktomk opened this issue May 13, 2017 · 7 comments

Comments

@ktomk
Copy link

ktomk commented May 13, 2017

On baguette-box.js:472:9

on triggering the click event of the #close-button element via javascript and when the gallery never was activated before.

        var closeButton = document.getElementById('close-button');
        closeButton && closeButton.click();
@feimosi
Copy link
Owner

feimosi commented May 13, 2017

Thanks for reporting that, but in which scenario it can occur? I can't really imagine one, where you try to close the lightbox before it was ever opened.

ktomk added a commit to ktomk/baguetteBox.js that referenced this issue May 13, 2017
Allows unchecked use of the close button click handler.

Refs.

- feimosi#151
@ktomk
Copy link
Author

ktomk commented May 13, 2017

Scenario is a single page "app" in which I have some custom navigation via URL fragment hashes. When history back and forth buttons are used the click event is pro-actively triggered to close a (potentially) opened baguette-box.

Currently I'm running it patched like this: dev...ktomk:patch-1#diff-4634650f8cf2cdceb34291a9bcf4c23f

@feimosi
Copy link
Owner

feimosi commented May 14, 2017

Ok, that makes sense. I'll patch it soon 👍

@ktomk
Copy link
Author

ktomk commented May 14, 2017

Great! I assume you don't need a PR for this otherwise just let me know.

@feimosi
Copy link
Owner

feimosi commented Sep 15, 2017

Fixed in 1cf4ec1

@ktomk
Copy link
Author

ktomk commented Sep 17, 2017

Thanks! Will refresh the deps on next website update!

@feimosi
Copy link
Owner

feimosi commented Sep 17, 2017

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants