feat(ui): unify retained window mounts
This commit is contained in:
parent
6e9e10367f
commit
a8e9503d2e
20 changed files with 823 additions and 366 deletions
|
|
@ -70,4 +70,25 @@ public class UiScrollableTests
|
|||
s.ScrollByPage(1);
|
||||
Assert.Equal(300, s.ScrollY);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetExtents_PreservesEndButRetainsUserScrollback()
|
||||
{
|
||||
var s = new UiScrollable();
|
||||
|
||||
s.SetExtents(contentHeight: 400, viewHeight: 100, preserveEnd: true);
|
||||
Assert.Equal(300, s.ScrollY);
|
||||
|
||||
// A scrollbar/wheel interaction moves off the end. Repeating layout with
|
||||
// the same extents must not overwrite that user-selected position.
|
||||
s.ScrollByLines(-1);
|
||||
Assert.Equal(284, s.ScrollY);
|
||||
s.SetExtents(contentHeight: 400, viewHeight: 100, preserveEnd: true);
|
||||
Assert.Equal(284, s.ScrollY);
|
||||
|
||||
// Returning to the end restores auto-pin for newly appended content.
|
||||
s.ScrollToEnd();
|
||||
s.SetExtents(contentHeight: 500, viewHeight: 100, preserveEnd: true);
|
||||
Assert.Equal(400, s.ScrollY);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue