fix(virtual_advanced_table): Prevent double Tab processing
- Check navigate_direction before setting tab_out in handleKeyboard - Export NavigateDirection from virtual_advanced_table module - Use cell_editor.NavigateDirection in VirtualAdvancedTableResult This fixes the bug where Tab was processed twice: once by CellEditor (for cell navigation) and again by handleKeyboard (for tab_out).
This commit is contained in:
parent
9b2cf2a3dd
commit
91969cb728
1 changed files with 7 additions and 3 deletions
|
|
@ -43,6 +43,7 @@ pub const CellGeometry = types.CellGeometry;
|
||||||
pub const DataProvider = data_provider.DataProvider;
|
pub const DataProvider = data_provider.DataProvider;
|
||||||
pub const CellEditorColors = cell_editor.CellEditorColors;
|
pub const CellEditorColors = cell_editor.CellEditorColors;
|
||||||
pub const CellEditorResult = cell_editor.CellEditorResult;
|
pub const CellEditorResult = cell_editor.CellEditorResult;
|
||||||
|
pub const NavigateDirection = cell_editor.NavigateDirection;
|
||||||
pub const drawCellEditor = cell_editor.drawCellEditor;
|
pub const drawCellEditor = cell_editor.drawCellEditor;
|
||||||
pub const VirtualAdvancedTableState = state_mod.VirtualAdvancedTableState;
|
pub const VirtualAdvancedTableState = state_mod.VirtualAdvancedTableState;
|
||||||
|
|
||||||
|
|
@ -106,7 +107,7 @@ pub const VirtualAdvancedTableResult = struct {
|
||||||
previous_row: ?usize = null,
|
previous_row: ?usize = null,
|
||||||
|
|
||||||
/// Navegación solicitada después de commit
|
/// Navegación solicitada después de commit
|
||||||
navigate_direction: cell_editor.CellEditorResult.NavigateDirection = .none,
|
navigate_direction: cell_editor.NavigateDirection = .none,
|
||||||
|
|
||||||
/// Tab presionado sin edición activa (pasar focus al siguiente widget)
|
/// Tab presionado sin edición activa (pasar focus al siguiente widget)
|
||||||
tab_out: bool = false,
|
tab_out: bool = false,
|
||||||
|
|
@ -1017,8 +1018,11 @@ fn handleKeyboard(
|
||||||
},
|
},
|
||||||
.tab => {
|
.tab => {
|
||||||
// Tab sin edición activa: indica que el panel debe mover focus
|
// Tab sin edición activa: indica que el panel debe mover focus
|
||||||
result.tab_out = true;
|
// IMPORTANTE: Solo si CellEditor no procesó Tab (evita doble procesamiento)
|
||||||
result.tab_shift = event.modifiers.shift;
|
if (result.navigate_direction == .none) {
|
||||||
|
result.tab_out = true;
|
||||||
|
result.tab_shift = event.modifiers.shift;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue