Skip to content

table: pass click modifiers through SelectRow event #2228

@boboshan

Description

@boboshan

Problem

TableEvent::SelectRow(usize) doesn't carry the keyboard modifiers from the click event. This makes it impossible to implement Cmd+click / Shift+click multi-row selection without adding on_mouse_down handlers to the row div, which breaks on_drag on child elements (GPUI's drag detection uses pending_mouse_down which conflicts).

Solution

Change SelectRow(usize) to SelectRow(usize, Modifiers) and pass e.modifiers() from the ClickEvent in on_row_left_click. Keyboard navigation (arrow keys) passes Modifiers::default() via the existing set_selected_row().

pub enum TableEvent {
    SelectRow(usize, gpui::Modifiers),  // was: SelectRow(usize)
    // ...
}

Adds set_selected_row_with_modifiers() alongside the existing set_selected_row() for backward compatibility.

Branch: boboshan/feat/select-row-modifiers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions