Browse Source

Fix Keyboard Handling

pull/5611/head
sdoroff 6 years ago
parent
commit
b48e7fe432
  1. 11
      src/Avalonia.Controls.DataGrid/DataGridCheckBoxColumn.cs

11
src/Avalonia.Controls.DataGrid/DataGridCheckBoxColumn.cs

@ -17,7 +17,6 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
public class DataGridCheckBoxColumn : DataGridBoundColumn public class DataGridCheckBoxColumn : DataGridBoundColumn
{ {
private bool _beganEditWithKeyboard;
private CheckBox _currentCheckBox; private CheckBox _currentCheckBox;
private DataGrid _owningGrid; private DataGrid _owningGrid;
@ -173,6 +172,7 @@ namespace Avalonia.Controls
} }
else else
{ {
System.Diagnostics.Debug.WriteLine($"InitialValue: {editingCheckBox.IsChecked}");
editingCheckBox.IsChecked = !editingCheckBox.IsChecked; editingCheckBox.IsChecked = !editingCheckBox.IsChecked;
} }
} }
@ -209,12 +209,6 @@ namespace Avalonia.Controls
ProcessPointerArgs(); ProcessPointerArgs();
} }
} }
else if (_beganEditWithKeyboard)
{
// Editing began by a user pressing spacebar
_beganEditWithKeyboard = false;
EditValue();
}
return uneditedValue; return uneditedValue;
} }
@ -308,13 +302,10 @@ namespace Avalonia.Controls
CheckBox checkBox = GetCellContent(row) as CheckBox; CheckBox checkBox = GetCellContent(row) as CheckBox;
if (checkBox == _currentCheckBox) if (checkBox == _currentCheckBox)
{ {
_beganEditWithKeyboard = true;
OwningGrid.BeginEdit(); OwningGrid.BeginEdit();
return;
} }
} }
} }
_beganEditWithKeyboard = false;
} }
private void OwningGrid_LoadingRow(object sender, DataGridRowEventArgs e) private void OwningGrid_LoadingRow(object sender, DataGridRowEventArgs e)

Loading…
Cancel
Save