-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[3.1.0] "class" attribute not being recomputed #16505
Comments
I first ran into this with a ternary {{my-button
class=(if isSubmitting 'button--in-progress' (if isSubmitted 'button--complete'))
}} where I converted it to a computed property and found it has the same problem submitClass: computed('isSubmitted', 'isSubmitting', function() {
if (this.get('isSubmitting')) return 'button--in-progress'
if (this.get('isSubmitted')) return 'button--complete'
return 'cruft' // with this line, it works; without it, it fails
}), |
I also ran into this, and this basically prevents us from using Ember 3.1, as it breaks our app in quite a lot of places (and was rather hard to track down!). Would be awesome to get a fix for this :) |
Does someone have time to put together a repo demonstrating the issue or possibly a failing test case PR here? |
Sure! It's pretty easy to reproduce. The relevant code is here: Also note, interestingly, if |
Just to confirm here, this is only an issue with passing |
I think this is likely similar to #16379 (which is fixed by #16563). Basically somewhere in the pipeline (likely curly component manager) we are doing a truthy check where we shouldn't be... |
We have something like this in a template:
This used to work fine until
3.1.0
- that is, whenisLoggedIn
is true, in addition to the classes inclassNames
,in
is added. WhenisLoggedIn
is false, then only the classes fromclassNames
are used. However, in3.1.0
this doesn't work any more.in
is not added even whenisLoggedIn
is true. It works only if we add a non-empty string to the else clause -(if isLoggedIn "in" "some-non-relevant-class")
.The text was updated successfully, but these errors were encountered: