Comments (4)
Currently, if there are 7 images in the photo set and cols
is set to 3, the component will display 3 images per row for the first two rows and one orphaned image on the last row using only 1/3rd of available space. See below.
It would be good to make cols
only applicable to rows that have enough images to support it. Otherwise, use the entire space.
from react-photo-gallery.
@iMerica this is correct behavior. it solves the other issue you had brought up about the last image being stretched and distorted. it's very jarring to have the last image have a very tall row height because its perhaps a portrait sized image trying to stretch the width of the app.
from react-photo-gallery.
Ahh that make sense now - thanks for explaining the motivation behind that. In my application, its users who are the ones uploading images of varying quantities and aspect ratios and all the images combined need to fit into a perfect quadrilateral/rectangle (I forked this repo to achieve that.)
One idea to satisfy all of the above use cases would be to sort all image aspect ratios so that a portrait image is never the last image in a hanging row 💡 .
from react-photo-gallery.
@iMerica hopefully not all of your images are portrait! perhaps we can add an api option where there are no trailing images so the last image goes into the last row.
from react-photo-gallery.
Related Issues (20)
- Lightbox image not centering HOT 3
- Adding attributes
- Handing images when they are missing
- Empty markup rendered using Jest and testing-library HOT 2
- React 17.x support HOT 6
- Rows Gallery Layout problem HOT 1
- Images become stretchy vertically on iPhone Safari HOT 6
- how to change number of image per row?
- How to load many images locally
- This Does not have support for react 17.0 HOT 2
- Additional props for photo
- Is is possible to cover images in gridview? HOT 1
- Caption, and hi-res download
- Add gap property to Gallery HOT 6
- How to add style to images?
- Custom dynamic columns example does not load
- Max image container width and height
- Defaultprops warning
- Can I use it with Angular?
- Update return type for `columns` function prop to `number | undefined`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-photo-gallery.