-
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(animations): process shorthand margin
and padding
styles correctly
#35701
Conversation
c4ba8f5
to
55a9fb4
Compare
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 once the type cast is fixed
* style value for the element. Firefox doesn't support reading the shorthand | ||
* forms of margin/padding and for this reason this function needs to account | ||
* for that. |
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 documenting this 👍
if (value.length === 0 && (prop === 'margin' || prop === 'padding')) { | ||
// reconstruct the padding/margin value as `top right bottom left` | ||
const propTop = (prop + 'Top') as 'marginTop' | 'paddingTop'; | ||
const propRight = (prop + 'Right') as 'marginRight' | 'paddingLeft'; |
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.
const propRight = (prop + 'Right') as 'marginRight' | 'paddingLeft'; | |
const propRight = (prop + 'Right') as 'marginRight' | 'paddingRight'; |
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.
fixed in the fixup
…ectly Prior to this patch, the `margin` and `padding` properties were not detected properly by Firefox due to them being shorthand properties. This patch ensures that both `margin` and `padding` are converted read as `top right bottom left` in the event that the shorthand property detection fails for auto-styling in Angular animations. Fix angular#35463 (FW-1886)
55a9fb4
to
b9ad30f
Compare
…ectly (#35701) Prior to this patch, the `margin` and `padding` properties were not detected properly by Firefox due to them being shorthand properties. This patch ensures that both `margin` and `padding` are converted read as `top right bottom left` in the event that the shorthand property detection fails for auto-styling in Angular animations. Fix #35463 (FW-1886) PR Close #35701
…les correctly (angular#35701)" This reverts commit 35c9f0d, breaks internal tests
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. |
Prior to this patch, the
margin
andpadding
properties were notdetected properly by Firefox due to them being shorthand properties.
This patch ensures that both
margin
andpadding
are convertedread as
top right bottom left
in the event that the shorthandproperty detection fails for auto-styling in Angular animations.
Fix #35463 (FW-1886)