-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/chips): chips form control updating value immediately #30818
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(material/chips): chips form control updating value immediately #30818
Conversation
@mmalerba , I have raised a new PR here. The old one seems to be messed up while rebasing. Also, I have added here the extra check for |
|
@mistrykaran91 I looked into one of the tests and the root of the problem seemed to be that a change event was fired even when the value didn't change. I think this is similar to what you were getting at with adding the |
Ok, Not sure how can I reproduce this one but i'll take a look and try to debug where it's failing |
9dff5e8
to
5915061
Compare
@mmalerba : I have added one |
f6ecbaf
to
d962c84
Compare
I'll give it a try, but I think a more robust solution might be to cache the previously emitted value and actually check if the current value is different than it before emitting. edit: re-ran it and it did fix some of the tests, but not all. I think the issue is that some people have special logic like "don't add it if its already in the list", "don't add it if its not a valid choice", etc. So I do think you'll need something like the previous value caching |
@mmalerba Got you, Just one question do I need to check the whole list before emitting the event, or should I just check the last value only, i.e., the string or so ? Or the value which is emitted from the |
I would just check the entire list |
d962c84
to
1dc18e7
Compare
@mmalerba : I have done the following changes:
|
ef7e114
to
f377d4d
Compare
Currently, when we have chips with form control, the value is updated only when its focused out. This fix will update the value of form control immediately Fixes angular#28065
f377d4d
to
c474eed
Compare
@mmalerba : Any update on this or anything I can take a look ? |
There are still internal test failures. This PR is likely too breaking to land outside of a major version change, and it will need someone with access to google's code to spend some time debugging and fixing the test failures before it can land. It'll have to be prioritized along with the other work the team is doing, so I can't really promise when we'll have time to look at it |
Ok, then better I'll close this MR. Just one thing we also same thing for |
Currently, when we have chips with form control, the value is updated only when its focused out. This fix will update the value of form control immediately
Fixes #28065