Commit ec0e821
committed
Fix auto_scroll end-following past code blocks / nested scrollables
Two issues broke auto_scroll's end-following when a tall child (e.g. a Markdown
code block) was inserted:
- The ScrollMetricsNotification listener reacted to *nested* scrollables (a code
block renders inside a horizontal scroller), tracking the wrong extent. Only
react to this scrollable's own metrics (notification.depth == 0).
- _onScroll unpinned purely on proximity (pixels >= max - threshold). A tall
insert jumps maxScrollExtent past the threshold in one frame while pixels
stays put, flipping to unpinned so it stopped following. Now it only unpins
when the user scrolls *up* (pixels decrease) and re-pins at the end; content
growing beneath a stationary position keeps it pinned.1 parent 4645958 commit ec0e821
1 file changed
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| |||
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
98 | 112 | | |
99 | 113 | | |
100 | 114 | | |
| |||
0 commit comments