-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Width and height are ignored when slide has a description #323
Comments
This won't help you – but I've got the same issue. Was just pulling my hair out over it, glad to know it's not just me. |
Can confirm this happens for me too. |
Seems if you set the description position to the right then the image size is OK. Maybe the interim is to do that and modify the CSS. |
I ended up using
|
Might this have something to do with the following lines of code? Lines 1081 to 1090 in 29e365d
This could also explain why it works on mobile, because the code of the Lines 1065 to 1069 in 29e365d
From what I can tell, glightbox/src/js/slides/image.js Lines 47 to 52 in 29e365d
I am not sure whether the use of |
Setting either a title or a description overrides the |
I've searched for over a hour to get this to working. imgNode.setAttribute('style', `max-height: calc(100vh - ${descHeight}px)`); But I couldn't find a way, to access the initial link element to access the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Why would you activate a stale bot to close inactive issues, when the repository is unmaintained. |
@biati-digital @felixranesberger @acc987 @trych Guys sorry for tagging you all, but just a short reply - did you find a solution to this problem? Have it now too.. Sorry + Thanks many times! |
Describe the bug
The width and height attributes that I assign to an image via
data-width="400px"
ordata-width="90vw"
etc. are only taken into consideration as long as I do not add adata-description="Bla bla"
attribute. As soon as I add one, the slide seems to take the full height (up to a maximum of100vh - descriptionHeight
).Are you able to reproduce the bug in the demo site
Yes, here is a codesandbox of the issue: https://codesandbox.io/s/glightbox-test-inline-props-rypsmn?file=/index.html
And here is the corresponding live page: https://rypsmn.csb.app/
To Reproduce
Add an image with
data-height
and/ordata-width
attributes, set up glightbox. The width and height should now work as expected. Now add adata-description
attribute with some text, the width and height are now ignored.Expected behavior
Width and height should still be taken into consideration.
Post the code you are using
See the codesandbox above.
Desktop:
Smartphone:
The text was updated successfully, but these errors were encountered: