-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Revert "Revert "feat(material/chips): prevent chips from being delete… #22235
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
Conversation
…d when user holds backspace (angular#19700)"" This is a roll-forward of the original PR. We will need to resolve the issues in Google's code base that caused it to be reverted before merging again. This reverts commit 4381b8e.
@gioragutt FYI |
… deleted when user holds backspace (angular#19700)""
@@ -156,7 +156,9 @@ export class MatChipInput implements MatChipTextControl, AfterContentInit, OnCha | |||
// We focus the last chip on backspace only after the user has released the backspace button, | |||
// And the input is empty (see behaviour in _keyup) | |||
if (event.keyCode === BACKSPACE && this._focusLastChipOnBackspace) { | |||
this._chipGrid._keyManager.setLastCellActive(); | |||
if (this._chipGrid._chips.length) { | |||
this._chipGrid._keyManager.setLastCellActive(); |
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.
Shouldn't this be handled by the GridKeyManager
?
Doesn't it have an indication of whether there are items or not?
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.
Yeah, it probably should, but we might want to do it as a follow-up PR. This one has already been tested and confirmed to not break anything (other than the one test that's being investigated). I'd like to avoid broadening the scope and potentially causing more failures
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.
NP. Let me know if you'd want me to take care of this later.
… deleted when user holds backspace (angular#19700)""
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. |
…d when user holds backspace (#19700)""
This is a roll-forward of the original PR. We will need to resolve the
issues in Google's code base that caused it to be reverted before
merging again.
This reverts commit 4381b8e.