-
-
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
The classNameBindings
property for the {{link-to}} helper doesn't update in 1.13.x
#11699
Comments
classNameBindings
property for the {{link-to}} helper doesn't update in 1.13classNameBindings
property for the {{link-to}} helper doesn't update in 1.13.x
Can confirm the same issue. |
This seems like a regression. Confirmed on 1.13.3. |
Confirmed, keeping us from migrating to 1.13. |
if someone has time to submit a PR with a failing test, that would help get the ball moving. |
I've submitted a failing test. I'm not entirely sure yet where in the stack the fix needs to be made. I'm looking into it. I'm happy to update the PR with the fix If I get to it before someone else. Any guidance on where this regression might have been introduced is also appreciated. |
Not sure if its helpful but this also fails using the newer inline if syntax, which I imagine just uses attributeBindings under the hood? I tried debugging this but got lost pretty quickly. In the |
Another few pieces of information: After additional debugging, I wanted to confirm that this does seem to be specific to {{#link-to 'home' classNameBindings='isHomeHighlighted:is-highlighted'}}Home{{/link-to}} And as @raytiley mentions, an inline if subexpression also does not work. Side note: I'm not sure which is correct here, {{#link-to 'home' classNames=(if isHomeHighlighted 'is-highlighted')}}Home{{/link-to}} {{#link-to 'home' class=(if isHomeHighlighted 'is-highlighted')}}Home{{/link-to}} However, the following cases do rerender correctly: Binding on a normal <a href='http://foo.bar' class={{if isHomeHighlighted 'is-highlighted'}}>Foo Bar</a> A standard generated blank component with {{#test-class-bindings classNameBindings='isHomeHighlighted:is-highlighted'}}Home{{/test-class-bindings}} |
In Ember 1.12 you could do
{{#link-to "path" classNameBindings="model.property:some-class"}}...
, and whenmodel.property
changed the link's class would change accordingly. I'm finding that in Ember 1.13 the class is set initially, but doesn't update dynamically asmodel.property
changes.Here's a JSBin: http://emberjs.jsbin.com/duvocorodo/edit?html,css,js,output
The text was updated successfully, but these errors were encountered: