Skip to content

Commit

Permalink
Revert "Use StringComparison.Ordinal for the comparison"
Browse files Browse the repository at this point in the history
This reverts commit 62211e5.
  • Loading branch information
danipen committed Jun 6, 2024
1 parent 62211e5 commit 83ea1a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private bool SearchAndSelectRow(TreeDataGrid treeDataGrid,
if (valueSelector != null && model != null)
{
var value = valueSelector(model);
if (value != null && value.ToUpper().StartsWith(candidatePattern, StringComparison.Ordinal))
if (value != null && value.ToUpper().StartsWith(candidatePattern))
{
UpdateSelection(treeDataGrid, newIndex, true);
treeDataGrid.RowsPresenter?.BringIntoView(newIndex);
Expand Down
4 changes: 4 additions & 0 deletions src/Avalonia.Controls.TreeDataGrid/TreeDataGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ protected override void OnKeyUp(KeyEventArgs e)
protected override void OnTextInput(TextInputEventArgs e)
{
base.OnTextInput(e);

if (e.Text is { Length: > 0 } && char.IsControl(e.Text[0]))
return;

_selection?.OnTextInput(this, e);
}

Expand Down

0 comments on commit 83ea1a8

Please sign in to comment.