Commit fcbb66b
This PR cherry-picks changes from the original PR #12267 to branch 25.2.
---
#### Original PR description
> When the virtualizer size changes, the scroll container height needs
to be updated. This used to happen reliably only because the virtualizer
called `scrollToIndex` unconditionally in that situation, and that call
force-updated the height as a side effect. However, that call was made
conditional in #11196, and
no longer happens when no scroll position needs to be restored. Without
it, the amortization logic in `_updateScrollerSize` can skip the height
update if the change is smaller than the viewport, so the scroll
container ends up with a stale height.
>
> This PR fixes that by making the size setter force the height update
with an explicit `_updateScrollerSize(true)` call. This also covers the
`allRowsVisible` growth scenario from #12146, so the complexity
introduced there is no longer needed and has been removed. The
regression tests from that PR still pass.
>
> Fixes vaadin/flow-components#9802
Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent ff14786 commit fcbb66b
3 files changed
Lines changed: 10 additions & 19 deletions
File tree
- packages
- component-base
- src
- test
- grid/src
Lines changed: 2 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
| |||
223 | 216 | | |
224 | 217 | | |
225 | 218 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | 219 | | |
232 | 220 | | |
233 | 221 | | |
| |||
426 | 414 | | |
427 | 415 | | |
428 | 416 | | |
| 417 | + | |
| 418 | + | |
429 | 419 | | |
430 | 420 | | |
431 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | 250 | | |
258 | 251 | | |
259 | 252 | | |
| |||
0 commit comments