-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(a11y): add wrap mode to key manager #1796
Conversation
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.
LGTM, minor comments
@@ -19,65 +19,130 @@ export interface MdFocusable { | |||
export class ListKeyManager { | |||
private _focusedItemIndex: number; | |||
private _tabOut: Subject<any> = new Subject(); | |||
private _wrapMode: boolean = false; |
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.
Just _wrap
?
keyManager.onKeydown(DOWN_ARROW_EVENT); | ||
keyManager.onKeydown(DOWN_ARROW_EVENT); | ||
expect(keyManager.focusedItemIndex) | ||
.toBe(2, `Expected focus to be on the last item of the list.`); |
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.
Overflow should be +4 indent
@jelbourn Comments addressed! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR adds support for two distinct modes:
As part of the default mode, it also supports the HOME and END keys jumping to the beginning and the end of the list, respectively.
To use wrap mode:
Closes #1608.