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
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 addingon_mouse_downhandlers to the row div, which breakson_dragon child elements (GPUI's drag detection usespending_mouse_downwhich conflicts).Solution
Change
SelectRow(usize)toSelectRow(usize, Modifiers)and passe.modifiers()from theClickEventinon_row_left_click. Keyboard navigation (arrow keys) passesModifiers::default()via the existingset_selected_row().Adds
set_selected_row_with_modifiers()alongside the existingset_selected_row()for backward compatibility.Branch:
boboshan/feat/select-row-modifiers