Skip to content

Commit b63a12e

Browse files
authored
table: Add set_right_clicked_row method. (#2230)
1 parent 3acccfd commit b63a12e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

crates/ui/src/table/state.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,15 @@ where
392392
self.right_clicked_row
393393
}
394394

395+
/// Set or clear the right-clicked row state.
396+
///
397+
/// Pass `None` to clear — useful when opening a header context menu
398+
/// to prevent the row context menu from appearing simultaneously.
399+
pub fn set_right_clicked_row(&mut self, row: Option<usize>, cx: &mut Context<Self>) {
400+
self.right_clicked_row = row;
401+
cx.notify();
402+
}
403+
395404
/// Returns the selected column index.
396405
pub fn selected_col(&self) -> Option<usize> {
397406
self.selected_col

0 commit comments

Comments
 (0)