fix(scroll): do not unpin a pinned tail reader on an above-tail collapse clamp (#7605)

This commit is contained in:
Kevin Meinon authored and GitHub committed 2026-09-16 07:03:36 -07:00
1 parent 345ce8baea
commit 906aebefa9
4 files changed
+257 -3

No files matched your search

+4 -1
View File
@@ -71,7 +71,10 @@ def test_scroll_listener_detects_upward_motion():
def test_upward_scroll_unpins_immediately_without_hysteresis():
"""Upward motion sets _scrollPinned=false and resets the counter, no count needed."""
block = _scroll_listener_block()
if_idx = block.index("if(movedUp)")
# The upward branch is the clamped one: it only fires once the reader has left
# the true bottom (bottomDistance>1), so an above-tail collapse clamp cannot
# unpin a reader who is still flush at the tail.
if_idx = block.index("if(movedUp&&bottomDistance>1){")
else_idx = block.find("else", if_idx)
assert else_idx > if_idx, "upward / downward branches not found (#1731)"
upward_branch = block[if_idx:else_idx]