diff --git a/widget/material/list.go b/widget/material/list.go index b9ca7be3..6f73f835 100644 --- a/widget/material/list.go +++ b/widget/material/list.go @@ -272,11 +272,11 @@ func (l ListStyle) Layout(gtx layout.Context, length int, w layout.ListElement) } majorAxisSize := l.state.Axis.Convert(listDims.Size).X start, end := fromListPosition(l.state.Position, length, majorAxisSize) + // layout.Direction respects the minimum, so ensure that the + // scrollbar will be drawn on the correct edge even if the provided + // layout.Context had a zero minimum constraint. + gtx.Constraints.Min = gtx.Constraints.Max anchoring.Layout(gtx, func(gtx layout.Context) layout.Dimensions { - // layout.Dimension respects the minimum, so ensure that the - // scrollbar will be drawn on the correct edge even if the provided - // layout.Context had a zero minimum constraint. - gtx.Constraints.Min = gtx.Constraints.Max return l.ScrollbarStyle.Layout(gtx, l.state.Axis, start, end) })