Skip to content

Commit dd6917e

Browse files
authored
Allows to hide dialog on escape press even when textbox has focus. (#815)
Also regains focus on wrong input when enter is used instead of allowing the terminal in the background to grab it.
1 parent e9769a7 commit dd6917e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

FluentTerminal.App/Dialogs/CustomCommandDialog.xaml.cs

+4
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,13 @@ private async void CommandTextBox_OnKeyUp(object sender, KeyRoutedEventArgs e)
233233
else
234234
{
235235
await new MessageDialog(error, I18N.Translate("InvalidInput")).ShowAsync();
236+
SetupFocus(); // needed to apply focus back to the textbox instead of the terminal in the background.
236237
}
237238
}
238239

240+
return;
241+
case VirtualKey.Escape:
242+
Hide();
239243
return;
240244
}
241245
}

0 commit comments

Comments
 (0)