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

Tab Key Doesn't Work on Form Within GLightbox Inline Content Modals #88

Closed
fatihturan opened this issue Feb 11, 2020 · 2 comments
Closed

Comments

@fatihturan
Copy link

Hi,

I'm using the Glighbox feature for opening form modal with inline content feature but I can't use the Tab key to navigating on inputs.

@biati-digital
Copy link
Owner

This should be fixed in the latest version 2.0.6, please note that an input must be focused in order to work otherwise the tab key will focus the Lightbox prev, next and close button.

@onetrev
Copy link

onetrev commented Jan 14, 2023

And just as a tip for someone looking to do this (set focus on the input in the modal), you need to do something like this:

lightbox.on('open', () => {
  function setFocus() {
    var element = document.querySelector('.ginlined-content .search-input');
    element.focus();
  }
  setFocus()
});

Note, it's important to use a class selector that targets the .ginlined-content class because if you try to use an id, it will fail due to how Glightbox works -- it duplicates the content in the modal so there are two of the same ids. :(

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

3 participants