-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(select): Select component keyboard type-ahead #10006
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
base: main
Are you sure you want to change the base?
Changes from all commits
ee5846b
f422165
0595fd9
f5fe02e
49a56ea
db10874
f2edf21
9bc3aa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -333,7 +333,8 @@ export class ListKeyboardDelegate<T> implements KeyboardDelegate { | |
| } | ||
|
|
||
| let collection = this.collection; | ||
| let key = fromKey || this.getFirstKey(); | ||
| let key = fromKey != null ? this.getNextKey(fromKey) : this.getFirstKey(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be better if we can handle this in |
||
| let hasWrapped = false; | ||
| while (key != null) { | ||
| let item = collection.getItem(key); | ||
| if (!item) { | ||
|
|
@@ -345,6 +346,11 @@ export class ListKeyboardDelegate<T> implements KeyboardDelegate { | |
| } | ||
|
|
||
| key = this.getNextKey(key); | ||
|
|
||
| if (key == null && !hasWrapped) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't need to do wrapping here, i think we already handle it in useTypeSelection, if a key wasn't found after the starting point, we try again from the top of the list |
||
| key = this.getFirstKey(); | ||
| hasWrapped = true; | ||
| } | ||
| } | ||
|
|
||
| return null; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.