You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the social-element also has the same attribute without a default value, which falls back to null.
So when the social component creates the attributes for the child, it uses this code:
getSocialElementAttributes() {
const base = {}
if (this.getAttribute('inner-padding')) {
base.padding = this.getAttribute('inner-padding')
}
return [
'text-padding',
MORE PROPERTIES
].reduce((res, attr) => {
res[attr] = this.getAttribute(attr)
return res
}, base)
}
It basically create a object with a lot of null values and these null values seem to override the default values from the child component, which makes no sense to me. Somehow you might have thought about that in the inner-padding, but I think the general component behavior is just wrong here.
This means that when a social-element is rendered inside a social component it has no text-padding anymore.
Describe the bug
It is a little bit harder to describe, but I found it when working on a port of mjml to C#:
It is general problem I think, but reproducible in the Social component.
The social element has the following property:
I am going to omit the other attributes because they are not relevant.
So when I render the mj-social-element standalone I have the following (simplified) output for the text:
But the social-element also has the same attribute without a default value, which falls back to null.
So when the social component creates the attributes for the child, it uses this code:
It basically create a object with a lot of null values and these null values seem to override the default values from the child component, which makes no sense to me. Somehow you might have thought about that in the inner-padding, but I think the general component behavior is just wrong here.
This means that when a social-element is rendered inside a social component it has no text-padding anymore.
To Reproduce
Expected behavior
Components should not override children
null
.MJML environment (please complete the following information):
The text was updated successfully, but these errors were encountered: