Don't close the command palette on backspace (#5291)

* Don't close the command palette on backspace

It leads to awkward UX like the one reported in #5007. Users can still
go back between arguments using <kbd>Backspace</kbd> on an empty
argument, but to close it they have to hit <kbd>Escape</kbd>,
<kbd>Cmd+K</kbd>, or click the close button.

* fmt
'
This commit is contained in:
Frank Noirot
2025-02-06 16:28:35 -05:00
committed by GitHub
parent 688852a5df
commit 020497cde2

View File

@ -57,7 +57,7 @@ function CommandComboBox({
onKeyDown={(event) => {
if (
(event.metaKey && event.key === 'k') ||
(event.key === 'Backspace' && !event.currentTarget.value)
event.key === 'Escape'
) {
event.preventDefault()
commandBarActor.send({ type: 'Close' })