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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

acdibble
Copy link

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
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
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
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
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

3 participants