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

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

maclementED
Copy link
Contributor

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

@rtivital rtivital merged commit 5aab807 into mantinedev:master Oct 3, 2024
1 check passed
@rtivital
Copy link
Member

rtivital commented Oct 3, 2024

Thanks!

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