Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@mantine/spotlight] createSpotlight : Reset the selected index when using the toggle function #6842

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maclementED
Copy link

Bug

When using spotlight.toggle instead of spotlight.open, using down arrow key will jump the first item.

How to reproduce

import { spotlight } from '@mantine/spotlight';

...

spotlight.open() // Will have selected:-1

spotlight.close()

spotlight.toggle() // Will have selected: 0 instead of -1. Using Down Arrow Key will skip the first item

Fix

Set the selected to -1 when you open the spotlight using toggle

@rtivital
Copy link
Member

Please fix errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants