mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
io/router,app: scroll a bit when reaching the end in a focus direction
List was recently changed to include an extra child at each end, to automatically scroll when reaching the end of a focus direction. However, if List includes unfocusable children that strategy may fail. This change adds another fallback where app.Window will scroll a constant amount in the focus direction, to reveal more children. For https://github.com/tailscale/tailscale/issues/4278. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -285,7 +285,7 @@ func TestFocusScroll(t *testing.T) {
|
||||
r.Frame(ops)
|
||||
|
||||
r.MoveFocus(FocusLeft)
|
||||
r.ScrollFocus(image.Rect(0, 0, 15, 40))
|
||||
r.RevealFocus(image.Rect(0, 0, 15, 40))
|
||||
evts := r.Events(h)
|
||||
assertScrollEvent(t, evts[len(evts)-1], f32.Pt(5, -10))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user