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
Margin shorthands are not patched correctly #441
Comments
Here are the pure dom operations: var node = document.createElement('div')
container.appendChild(node)
node.style.margin = '10px 20px 40px';
node.style.marginRight = '30px';
node.style.marginRight = ''; Result: <div style="margin-top: 10px; margin-bottom: 40px; margin-left: 20px;"></div> The shorthand itself is the problem... 😢 |
React issue: facebook/react#6348 |
I don't think this is a problem of snabbdom. As shown from your pure dom operations that browser still behaves quirky with
because two different properties are being diffed. The workaround soln is to use
|
Correct. The solution is to not use shorthands. This should be clearly noted in the readme, else people get unexpected behavior. |
Closing this in favor of #815. |
When merging and patching margin/padding shorthands, the result is wrong:
Fiddle: https://jsfiddle.net/m7t4xj12/1/
The text was updated successfully, but these errors were encountered: