-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
model rollback doesn't clear model.errors.attribute #3498
Comments
DEBUG: ------------------------------- |
looking in to it |
@smcclstocks what is the exact value of |
I was only using != 0 for illustration & don't use that in my app at all. But I notice the same thing you said with is model.get('errors.attribute.length') is null after the rollbackAttributes(). But the templates don't reflect that for some reason. The template will properly reflect the rollback by setting the value back to the original but the template never reflects the fact that the attributes error length is no null. Here's my example:
In that case the attribute I'm testing with is obviously named street & after the rollback I get what you said in the console logs:
But the template instead continues to show:
Do you see that in your testing as well? |
Closes emberjs#3498 (cherry picked from commit ec5d73e) Conflicts: packages/ember-data/lib/system/model/errors.js
Steps to reproduce:
This leave the UI displaying errors when the model has been rolled back & the validation errors should no longer be present. In my case the attribute is name firstName so in step 5 above model.errors.attribute.length is model.errors.firstName.length. I could be missing something so sorry for the waste of time if so.. i can't seem to work around this although model.get('errors').has('firstName') does return false after the rollback even though the array of messages are still present.
When I transition away & come back the UI no longer shows the errors so I wasn't sure if this was something to do with my templates instead. Thanks ahead of time.
The text was updated successfully, but these errors were encountered: