haaarshsingh / kmenu

The perfect ⌘K menu
https://kmenu.harshsingh.xyz
MIT License
780 stars 25 forks source link

[BUG] Delete/backspace button brings user back to root menu #109

Open heymartinadams opened 8 months ago

heymartinadams commented 8 months ago

Describe the bug When the user is at a menu with index n with n > 2, the expectation is that clicking the delete or backspace key gets the user to the immediately preceding menu, so n - 1. Instead, the root menu n === 1 is called.

To Reproduce Steps to reproduce the behavior:

  1. Create 3 or more menus, e.g.
    <CommandMenu commands={menuMain} index={1} placeholder='Type a command or search...' />
    <CommandMenu commands={menuTask} index={2} placeholder='Describe your task' />
    <CommandMenu commands={menuFilter} index={3} placeholder='Filter...' />
  2. Navigate to the third menu, with the placeholder “Filter...”
  3. Press the delete button.
  4. You get taken back to the main menu with the placeholder “Type a command or search...”.

Expected behavior User should be taken back to the immediately preceding menu. In the example above, the menu with the placeholder “Describe your task”.

Desktop (please complete the following information):

haaarshsingh commented 8 months ago

hey @heymartinadams, thanks for bringing this to my attention, i'll get on it asap.