Skip to content

Commit 431c3ee

Browse files
committed
-prevent Selection in AutoSuggestBox if the DropDown-List is not open
-do not mark event as handled to enable "normal" TAB and Shift+TAB behavior
1 parent aca6b24 commit 431c3ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/MaterialDesignThemes.Wpf/AutoSuggestBox.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ protected override void OnPreviewKeyDown(KeyEventArgs e)
167167
default:
168168
return;
169169
}
170-
e.Handled = true;
171170
}
172171

173172
protected override void OnLostFocus(RoutedEventArgs e)
@@ -233,6 +232,11 @@ private void CommitValueSelection()
233232

234233
private void CommitValueSelection(object? selectedValue)
235234
{
235+
if (IsSuggestionOpen == false)
236+
{
237+
return;
238+
}
239+
236240
string oldValue = Text;
237241
Text = selectedValue?.ToString();
238242
if (Text != null)

0 commit comments

Comments
 (0)