-
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
fix(chips): fix chip list focus and keyboard behaviors #7319
Conversation
src/lib/chips/chip-list.ts
Outdated
@@ -432,9 +432,9 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor | |||
|
|||
let isPrevKey = (code === (isRtl ? RIGHT_ARROW : LEFT_ARROW)); | |||
let isNextKey = (code === (isRtl ? LEFT_ARROW : RIGHT_ARROW)); | |||
let isBackKey = (code === BACKSPACE || code == DELETE || code == UP_ARROW || isPrevKey); | |||
let isDeleteKey = code === BACKSPACE || code == DELETE; | |||
// If they are on an empty input and hit backspace/delete/left arrow, focus the last chip |
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.
nit: not left arrow anymore
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.
Updated comment. Thanks for review!
7aa87ec
to
2baf3f4
Compare
src/lib/chips/chip-list.ts
Outdated
// If they are on an empty input and hit backspace/delete/left arrow, focus the last chip | ||
if (isInputEmpty && isBackKey) { | ||
let isDeleteKey = code === BACKSPACE || code == DELETE; | ||
// If they are on an empty input and hit backspace/delete, focus the last chip |
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.
I'm not sure the delete key should do this in addition to backspace. In both Drive and GMail, the delete key just does nothing when your focus is on the empty input.
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.
Removed delete key. Thanks for review!
2baf3f4
to
6d542ff
Compare
6d542ff
to
b385300
Compare
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
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. |
Fixes #7240 #7242