╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1280 pub fn build(self: *HeaderScroll, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void { │ │1281 self.clearGrid(); │ │1282 const row_box = self.row(); │ │1283 - // bring the focused child into view where the last build put it │ │1284 - if (!self.scroll.options.web_native) if (row_box.getFocus().child_id) |id| if (row_box.children.get(id)) |child| if (child.rect) |rect| self.scroll.scrollToRect(rect);│ │1283 + // bring the focused child into view where the last build put it. one │ │1284 + // wider than the window shows its start, since chasing both its edges │ │1285 + // would scroll back and forth on every build. │ │1286 + if (!self.scroll.options.web_native) if (row_box.getFocus().child_id) |id| if (row_box.children.get(id)) |child| if (child.rect) |rect| { │ │1287 + var target = rect; │ │1288 + if (self.scroll.viewport) |viewport| target.size.width = @min(rect.size.width, viewport.width); │ │1289 + self.scroll.scrollToRect(target); │ │1290 + }; │ │1291 │ │1292 // the window's width, or the children's minimums when they need more. │ │1293 // only a max, since a min would stretch the row's last laid out child. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯