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(chips): fix chip list focus and keyboard behaviors #7319

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

tinayuangao
Copy link
Contributor

Fixes #7240 #7242

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 26, 2017
@@ -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
Copy link
Contributor

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

Copy link
Contributor Author

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!

// 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
Copy link
Member

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.

Copy link
Contributor Author

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!

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Sep 27, 2017
@andrewseguin andrewseguin merged commit f166468 into angular:master Sep 29, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chip List incorrectly sets focus to Chip Input when chips are remove programattically
5 participants