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

Set Elements not work if Title or description set #525

Open
doiftrue opened this issue Aug 17, 2024 · 4 comments
Open

Set Elements not work if Title or description set #525

doiftrue opened this issue Aug 17, 2024 · 4 comments

Comments

@doiftrue
Copy link

doiftrue commented Aug 17, 2024

Describe the bug


Are you able to reproduce the bug in the demo site
No.

To Reproduce
Steps to reproduce the behavior:

  1. Add this code:
document.addEventListener( 'DOMContentLoaded', function(){

    const lb = GLightbox( {
  	  zoomable: true,
  	  selector: '',
  	  elements: [
  		  {
  			  type: 'image',
  			  href: 'https://picsum.photos/1200/800',
  			  title: 'My Title',
  			  description: 'Example',
  		  },
  		  {
  			  type: 'image',
  			  href: 'https://picsum.photos/1200/800',
  			  title: 'My Title',
  			  description: 'Example',
  		  }
  	  ]
    } )
    lb.openAt( 0 )

} );
  1. It not work.
  2. Remove title and description parameters it's works fine.

Expected behavior
Opened lightbox slide.

Post the code you are using
Help me solve issues faster, if I can copy paste your code I can try to reproduce and fix the bug faster.

Screenshots
image
image
image

Such ternary fix the problem:
image
image

Desktop:

  • OS: [Linux]
  • Browser [chrome]
@luglio7
Copy link

luglio7 commented Aug 19, 2024

same problem here

@gingerchew
Copy link
Collaborator

@doiftrue Can you create a codepen or codesandbox with a minimized test case?

@rtkirill
Copy link

rtkirill commented Aug 28, 2024

same issue

FYI: work only if set descPosition: 'right'

@Jisco
Copy link

Jisco commented Nov 30, 2024

same issue

It only works when i set "left" or "right".

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

No branches or pull requests

5 participants