Merged
Conversation
ai
reviewed
Feb 20, 2024
menu.js
Outdated
| focus(event.target, items[items.length - 1]) | ||
| } else { | ||
| let nextItem = Array.from(items).find( | ||
| item => item.textContent?.[0]?.toLowerCase() === event.key.toLowerCase() |
Owner
There was a problem hiding this comment.
We may need trim() to avoid finding anything by Space
ai
reviewed
Feb 20, 2024
menu.js
Outdated
| } else if (event.key === 'End') { | ||
| event.preventDefault() | ||
| focus(event.target, items[items.length - 1]) | ||
| } else { |
Owner
There was a problem hiding this comment.
We need not only to find by first letter, but also by some pattern of letters pressed with a small delay.
Like:
a— looking forabafter 100ms — looking forabcafter 50ms — looking forabcdafter 5000ms — looking ford
menuKeyUXmenuKeyUX
ai
reviewed
Feb 20, 2024
| event.preventDefault() | ||
| focus(event.target, items[items.length - 1]) | ||
| } else if (event.key.length === 1) { | ||
| let curTime = new Date().getTime() |
Owner
There was a problem hiding this comment.
Suggested change
| let curTime = new Date().getTime() | |
| let curTime = Date.now() |
Owner
|
Also check out how was possible to reduce 22 bytes 207d946 |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1