Support nested scrollables

Nested scrolling regions do not work properly. This has been a known issue for some time, and I'm only creating this ticket to make it easier to find. This isn't a fundamental problem, but just something that needs implementing.

Assigned to
a month ago
a month ago
No labels applied.

~eliasnaur closed duplicate ticket #148 a month ago

~eliasnaur a month ago

~eliasnaur a month ago

In response to a patch by ~inkeliz:

In Gio, the input events are disambiguated by io/router.Router, implemented by the pointerQueue. I think a better solution to the nested scrolling problem is to expand the router to correctly disambiguate scroll events.

Right now the Router doesn't have enough information to know whether one widget can use a particular scroll event. InputOp.Types only says whether a widget is scrollable, not how far it scrolls.

I suggest providing this information by adding it to InputOp, say:

    package pointer

    type InputOp struct {
            XScrollRange ScrollRange
            YScrollRange ScrollRange

    // ScrollBounds represent a range of scrolling along an axis.
    type ScrollRange struct {
            // Min and Max limit the range to [Min,Max] pixels.
            Min, Max int

I have ideas to handle mobile gesture scrolls, but let's fix the mouse first.

[0] https://gioui.org/issue/148

[1] https://gophers.slack.com/archives/CM87SNCGM/p1591237250177700

Register here or Log in to comment, or comment via email.