Commit 54bb501
fix(virtual-core): notify synchronously after above-viewport resize compensation
`resizeItem` writes `scrollTop` synchronously inside the ResizeObserver
callback to compensate for an above-viewport size change, but then notified
asynchronously. The browser could paint one frame with the new `scrollTop`
and the old item transforms, so the viewport visibly jumped by the resize
delta and snapped back on the next commit (#1227) — the scrollbar stayed
anchored (skew=0) but the content flashed.
When a compensation actually moves the scroll position, notify synchronously
so the transform commit lands in the same paint as the scroll write. Resizes
that move nothing (below-fold measurements) and iOS-deferred adjustments keep
the cheaper async notify. `applyScrollAdjustment` now reports whether it wrote
`scrollTop` this tick to drive that decision.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ef6e92a commit 54bb501
3 files changed
Lines changed: 83 additions & 5 deletions
File tree
- .changeset
- packages/virtual-core
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
683 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
684 | 691 | | |
685 | 692 | | |
686 | 693 | | |
| |||
691 | 698 | | |
692 | 699 | | |
693 | 700 | | |
| 701 | + | |
694 | 702 | | |
695 | 703 | | |
696 | 704 | | |
| |||
716 | 724 | | |
717 | 725 | | |
718 | 726 | | |
| 727 | + | |
719 | 728 | | |
720 | 729 | | |
721 | 730 | | |
| |||
1599 | 1608 | | |
1600 | 1609 | | |
1601 | 1610 | | |
| 1611 | + | |
1602 | 1612 | | |
1603 | | - | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
1604 | 1616 | | |
1605 | | - | |
| 1617 | + | |
1606 | 1618 | | |
1607 | 1619 | | |
1608 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
1609 | 1631 | | |
1610 | 1632 | | |
1611 | 1633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2553 | 2553 | | |
2554 | 2554 | | |
2555 | 2555 | | |
| 2556 | + | |
2556 | 2557 | | |
2557 | 2558 | | |
2558 | 2559 | | |
| 2560 | + | |
2559 | 2561 | | |
2560 | 2562 | | |
2561 | 2563 | | |
| |||
2571 | 2573 | | |
2572 | 2574 | | |
2573 | 2575 | | |
| 2576 | + | |
2574 | 2577 | | |
2575 | 2578 | | |
2576 | 2579 | | |
| |||
2735 | 2738 | | |
2736 | 2739 | | |
2737 | 2740 | | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
2738 | 2789 | | |
2739 | 2790 | | |
2740 | 2791 | | |
| |||
0 commit comments