-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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(core): correctly concatinate static and dynamic binding to `class… #35350
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up! Some minor changes requested below.
- Can we also add some context to the commit message itself on what was broken and how we fixed it?
- In the commit, concatinate => concatenate
…` when shadowed Given: ``` <div class="s1" [class]="null" [ngClass]="exp"> ``` Notice that `[class]` binding is not a `string`. As a result the existing logic would not concatenate `[class]` with `class="s1"`. The resulting falsy value would than be sent to `ngClass` which would promptly clear all styles on the `<div>` The new logic correctly handles falsy values for `[class]` bindings. Fix angular#35335
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the great commit message
…` when shadowed (#35350) Given: ``` <div class="s1" [class]="null" [ngClass]="exp"> ``` Notice that `[class]` binding is not a `string`. As a result the existing logic would not concatenate `[class]` with `class="s1"`. The resulting falsy value would than be sent to `ngClass` which would promptly clear all styles on the `<div>` The new logic correctly handles falsy values for `[class]` bindings. Fix #35335 PR Close #35350
…` when shadowed (angular#35350) Given: ``` <div class="s1" [class]="null" [ngClass]="exp"> ``` Notice that `[class]` binding is not a `string`. As a result the existing logic would not concatenate `[class]` with `class="s1"`. The resulting falsy value would than be sent to `ngClass` which would promptly clear all styles on the `<div>` The new logic correctly handles falsy values for `[class]` bindings. Fix angular#35335 PR Close angular#35350
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…` when shadowed
Given:
Notice that
[class]
binding is not astring
. As a result the existing logic would not concatenate[class]
withclass="s1"
. The resulting falsy value would than be sent tongClass
which would promptly clear all styles on the<div>
The new logic correctly handles falsy values for
[class]
bindings.Fix #35335
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information