Put card list grid items in rows#122
Open
adebroux wants to merge 3 commits into
Open
Conversation
Contributor
Author
michael-adalo
suggested changes
Jun 19, 2023
Comment on lines
+69
to
+71
| let columnCount = this.getColumnCount() | ||
| let count = Math.ceil(items.length / columnCount) | ||
| let rows = [] |
Contributor
There was a problem hiding this comment.
nitpick: it should be possible to declare each of these as const, including rows.
| {rows.map((row, i) => ( | ||
| <View key={i} style={styles.row}> | ||
| {row.map((itm) => ( | ||
| <View style={columnWidth}> |
Contributor
There was a problem hiding this comment.
should this <View> also have a key attribute as it's directly within the .map()? Looking at the previous code, I see renderCell() includes a key attribute that probably isn't effective anymore.
| let { fullWidth } = this.state | ||
| let width = fullWidth / columnCount - 8 | ||
| const rows = this.getRows(items) | ||
| const columnWidth = { width: `${100 / columnCount}%` } |
Contributor
There was a problem hiding this comment.
nitpick: would it be worth calling this something like cellContainerStyles, or something similar, since the object could potentially contain any number of styles?
Alternatively, setting it directly on the <View> would also be fine.
| editor, | ||
| } = this.props | ||
|
|
||
| let mediaPosition = media && media.position |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Card lists set to grid layout in responsive apps would have their height automatically collapse when they were selected in the editor.
https://trello.com/1/cards/645d32b21deee39c9c1d0441/attachments/645d35fac46e4d60cda83fb2/download/screencast_2023-05-11_22-35-32.mp4
Solution
Give the grid layout some structure, like we do with the masonry layout. Instead of just having a list of items, create rows for those items.
Additional Notes
There's still a problem where when you change the screen size or resize the component, the height of the items changes, but the bounding box for the card list component doesn't update until you de-select and re-select the component. This is a pre-existing issue with the card list in masonry layout, as well as the image list.
There's also a pre-existing issue with the card list in multi-column grid layout where it will flicker between showing 1 and 2 columns. We have a card for this already in the backlog.