Skip to content

Commit bce2972

Browse files
committed
debugui: reland: skip handling input and rendering widgets outside of scroll
Updates #41
1 parent a29b0e1 commit bce2972

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

widget.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ func (c *Context) widget(id widgetID, opt option, layout func(bounds image.Recta
124124
if handleInput != nil {
125125
e = handleInput(bounds, wasFocused)
126126
}
127+
// Handling input is still needed even if the widget is out of bounds, especially for Header.
128+
if !c.currentContainer().layout.BodyBounds.Overlaps(bounds) {
129+
return e, nil
130+
}
131+
127132
if draw != nil {
128133
draw(bounds)
129134
}

0 commit comments

Comments
 (0)