╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮ │208 │ │209 pub fn build(self: *SelectableList, constraint: layout.Constraint, root_focus: *Focus) !void {│ │210 self.clearGrid(); │ │211 + const pane_has_focus = root_focus.grandchild_id == self.getFocus().id; │ │212 const children = &self.scroll.child.box.children; │ │213 for (children.keys(), children.values()) |id, *item| { │ │214 item.widget.text_box.options.border_style = if (self.getFocus().child_id == id) │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │214 - (if (root_focus.grandchild_id == id) .double else .single) │ │215 + // pane_has_focus will be true if the widgets weren't yet in │ │216 + // the focus tree, and so setFocus stopped at the pane itself. │ │217 + // in this case, it should be treated as if it's selected. │ │218 + (if (root_focus.grandchild_id == id or pane_has_focus) .double else .single)│ │219 else │ │220 .hidden; │ │221 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │218 - // force a minimum row of content so an empty list still produces a │ │219 - // non-zero grid. without this, xitui's Scroll.build copies from a │ │220 - // zero-cell child grid and traps with OOB in release builds because │ │221 - // NDSlice.at's bounds check is gated on runtime_safety. │ │222 - var adjusted = constraint; │ │223 - adjusted.min_size.height = @max(adjusted.min_size.height orelse 0, 1); │ │224 - try self.scroll.build(adjusted, root_focus); │ │222 + try self.scroll.build(constraint, root_focus); │ │223 } │ │224 │ │225 pub fn input(self: *SelectableList, key: inp.Key, root_focus: *Focus) !void {│ ╰──────────────────────────────────────────────────────────────────────────────────────╯