kbar icon indicating copy to clipboard operation
kbar copied to clipboard

[feature]: Allow looping when navigating the results list

Open AkashRajpurohit opened this issue 3 years ago • 2 comments

When a user reaches the end of the list, on pressing the ArrowDown the list selection does not move back to the first item.

We can add a feature to allow the list to continue the looping when it reaches the end of either side of the list, i.e. go to first item when clicked ArrowDown on last item and go to last item when clicked ArrowUp on first item.

We can take an optional prop for the KbarResults, something like allowLoop and maintain backward compatibility by having its default value as false which is the current behavior. When set to true, we can enable the flow mentioned above.

If this is something you feel can add value to the package, I can work on this feature and send a PR :)

AkashRajpurohit avatar Jun 21 '22 04:06 AkashRajpurohit

+1 for this feature

benatpigment avatar Jun 24 '22 08:06 benatpigment

@benatpigment If you would like to review, I have created an PR for adding this #226 :)

AkashRajpurohit avatar Jun 26 '22 10:06 AkashRajpurohit

Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 30 '22 22:08 stale[bot]