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

Fix flexsearch arrow key navigation error #509

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

schnerring
Copy link
Contributor

Currently there is an error due to an edge case when navigating through flexsearch results with the keyboard arrow keys.

You can reproduce the issue by entering something in the search input that produces 0 results. If you press an arrow key after, an error is thrown.

I also added flatMap to simplify search result flattening. It's supported by most browsers: https://caniuse.com/array-flat

If you miss any browser you'd like to support because of that, I'll revert the flatMap change.

Copy link
Member

@h-enk h-enk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced + verified (https://deploy-preview-509--doks.netlify.app/). Super thanks!

@h-enk h-enk merged commit 6614ea5 into gethyas:master Oct 14, 2021
@schnerring schnerring deleted the flexsearch-bugfix branch October 14, 2021 20:36
adhadse pushed a commit to adhadse/doks that referenced this pull request Sep 17, 2022
Fix flexsearch arrow key navigation error
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.

None yet

2 participants