albingroen/react-cmdk

Navigation to previous commands.

lucky-chap opened this issue · 5 comments

Whenever a user navigates to a command with sub-commands, there's nothing to tell the user to press the Escape key to go back. I think showing some sort of help message can make the user navigate back from deep sub-commands, without trying to figure out which key to press. This is a huge problem on mobile phones

Hi Quavo, I understand your problem and I will try to think of a good solution. For now though, maybe you can just render a back option, like this?
image

@albingroen Could you utilize delete or backspace, as raycast does?

They also include a "back" button:

Raycast back button

You can also use the footer property on the root component to show something like this.

image

Semmu commented

Just found this lib and wanted to say the same: going up a level via backspace would be really useful to implement.

This PR adds support for hitting Backspace to move up a page (runs the onEscape if specified)
#8