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: only focus active elements #631

Merged
merged 4 commits into from
May 31, 2024

Conversation

acdibble
Copy link
Contributor

When wrapping around at the beginning or end of the list of components, we should search respectively for the last or first active component.

I didn't use Array.prototype.findLast because the tsconfig doesn't support it and it was simple enough to write a loop.

@sindresorhus
Copy link
Collaborator

I didn't use Array.prototype.findLast because the tsconfig doesn't support it and it was simple enough to write a loop.

We now target Node.js 18, so it should be fine to use .findLast.

@acdibble
Copy link
Contributor Author

acdibble commented Nov 6, 2023

I didn't use Array.prototype.findLast because the tsconfig doesn't support it and it was simple enough to write a loop.

We now target Node.js 18, so it should be fine to use .findLast.

Cool, I'll fix it up soon

@acdibble
Copy link
Contributor Author

acdibble commented Nov 6, 2023

Done!

@vadimdemedes
Copy link
Owner

@acdibble Thanks for this PR! Could you add a test for this behavior?

@acdibble
Copy link
Contributor Author

@acdibble Thanks for this PR! Could you add a test for this behavior?

@vadimdemedes , I added three tests.

I also had to update the tsconfig to include the ES2023 lib in order to get the compilation to work and the tests to run. This seems safe because Node 18 supports all of ES2023 (https://node.green/#ES2023).

readme.md Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit d8bcff8 into vadimdemedes:master May 31, 2024
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.

3 participants