-
Notifications
You must be signed in to change notification settings - Fork 35
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
Images are too big when there aren't enough to fill the row #121
Comments
It seems to be out of scope of this library. However there is a workaround. Maybe it helps: |
@dawi thank you for linking that discussion! @rigon the above workaround is probably the easiest and the most elegant solution for this edge case. Unfortunately, implementing this as a feature in the library isn't as straightforward because I'll go ahead and close this ticket. However, if someone is willing to propose a solution, I'd be happy to review a PR. |
I couldn't get this edge case out of my head, so I ended up implementing this feature. It did require some refactoring, but I'm happy with the result. Here is how you can define maximum row height when there isn't enough photos to fill more than one row: <PhotoAlbum
layout="rows"
photos={photos}
targetRowHeight={150}
rowConstraints={{ singleRowMaxHeight: 200 }}
/> Usage notes:
|
🎉 This issue has been resolved in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@igordanchenko I really appreciate that you took the time to address this issue. I already integrated it in the project I'm working on and does work like a charm. Thank you! 👏 👏 |
Describe the bug
The images become too big when there aren't enough of them to fill the row.
Expected behavior
Having an option to configure what to do when that occurs. I see three different configurations, I think you should decide which should go forward:
maxRowHeight
How to reproduce
Create a gallery with let's say one image, but the container for react-photo-album taking all the width available.
Screenshots / Logs
Current behavior:
Expected:
Additional context
No response
The text was updated successfully, but these errors were encountered: