╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2705 .background => |rgb| session.terminal_background = rgb, │ │2706 .resize => try root.input(allocator, key, root_focus), │ │2707 }, │ │2708 - // a scroll tick goes to the pane under the pointer, focusing it first │ │2708 + // a scroll tick goes to the pane under the pointer, focusing it first. │ │2709 + // from a text input it moves like the arrows instead, so scrolling up │ │2710 + // from a search box reaches the header. │ │2711 .scroll_up, .scroll_down => |position| { │ │2710 - if (scrollUnder(root_focus, position)) |scroll_id| { │ │2712 + if (!focusInTextInput(root_focus)) if (scrollUnder(root_focus, position)) |scroll_id| {│ │2713 if (!focusInside(root_focus, scroll_id)) root_focus.setFocus(scroll_id); │ │2712 - } │ │2714 + }; │ │2715 try root.input(allocator, key, root_focus); │ │2716 }, │ │2717 else => try root.input(allocator, key, root_focus), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │2743 return found; │ │2744 } │ │2745 │ │2746 +fn focusInTextInput(root_focus: *const Focus) bool { │ │2747 + const focused = root_focus.grandchild_id orelse return false; │ │2748 + const child = root_focus.children.get(focused) orelse return false;│ │2749 + return switch (child.focus.kind) { │ │2750 + .text_input, .text_input_password, .text_area => true, │ │2751 + else => false, │ │2752 + }; │ │2753 +} │ │2754 + │ │2755 // whether the focused widget is `id` or lies under it │ │2756 fn focusInside(root_focus: *const Focus, id: usize) bool { │ │2757 var current = root_focus.grandchild_id orelse return false; │ ╰─────────────────────────────────────────────────────────────────────────────╯