-
-
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
Binding style attributes warning #11395
Comments
Can you please provide a demo JSBin so we can help you a bit better here? |
Here's a demo jsbin showing this behavior. Using a computed property inside a
|
Yes, @bantic is correct. You can return a |
Specifically, we would accept a patch that causes |
@mixonic why would |
@luxferresum to know that It is just a big problem, and needs a champion to own it and execute. |
@mixonic Well that would be awesome, but its only true if |
Just think that, in general, the concatenation of two safe strings does not need to be a safe string. This currently happens in code too: If you were to move that to a property, you would need to mark the final string as safe, even if you don't think it is needed. I think Ember should fall on the safe side and the only case where a safe string can be guaranteed to still be a safe string is in the |
It's an unnecessary warning, it works, and people like me will just go with the warning if there is no easy way around. Building the entire style property in JS is not really a fancy solution. Also isn't that what @rwjblue said?
That two safe strings are a normal string is normal and a JS limitation. There is no way to overload |
Given the following template: ```hbs <div style="{{myStyle}}"></div> ``` It behaves exactly like: ```hbs <div style={{myStyle}}></div> ``` Fix emberjs#11395
Given the following template: ```hbs <div style="{{myStyle}}"></div> ``` It behaves exactly like: ```hbs <div style={{myStyle}}></div> ``` Fix emberjs#11395
Given the following template: ```hbs <div style="{{myStyle}}"></div> ``` It behaves exactly like: ```hbs <div style={{myStyle}}></div> ``` Fix emberjs#11395
Given the following template: ```hbs <div style="{{myStyle}}"></div> ``` It behaves exactly like: ```hbs <div style={{myStyle}}></div> ``` Fix emberjs#11395
Unfortunately there doesn't seem to be a way to disable the warning on the link given.
Code for escapeCSS is not given so I cannot use this and should not need to as it is just a calculated RGB value.
I do return a ().htmlSafe()
Thanks.
The text was updated successfully, but these errors were encountered: