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:
@ -57,7 +57,7 @@ function CommandComboBox({
|
|||||||
onKeyDown={(event) => {
|
onKeyDown={(event) => {
|
||||||
if (
|
if (
|
||||||
(event.metaKey && event.key === 'k') ||
|
(event.metaKey && event.key === 'k') ||
|
||||||
(event.key === 'Backspace' && !event.currentTarget.value)
|
event.key === 'Escape'
|
||||||
) {
|
) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
commandBarActor.send({ type: 'Close' })
|
commandBarActor.send({ type: 'Close' })
|
||||||
|
Reference in New Issue
Block a user