Commit 073b7e0
committed
fix: Respect Sortable.Flex alignItems before items are measured
Sortable.Flex put `alignSelf: 'flex-start'` on every item to stop them
stretching (stretched items would be measured at the wrong size, which
breaks the absolute layout). But `alignSelf` overrides the container's
`alignItems`, so a user-provided `alignItems` (e.g. 'center') was ignored
until the component switched to its absolute layout after measuring,
causing a visible jump with differently-sized items.
Prevent stretching on the container instead: fall back to `alignItems:
'flex-start'` when no `alignItems` is set (the default that would
stretch), and drop the per-item `alignSelf` override. Any provided
`alignItems` now applies from the first render.1 parent 92fe9da commit 073b7e0
1 file changed
Lines changed: 2 additions & 10 deletions
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | | - | |
| 226 | + | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | 238 | | |
240 | 239 | | |
241 | 240 | | |
242 | 241 | | |
243 | 242 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 243 | | |
0 commit comments