Skip to content
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

Pre-existing style attribute is removed from vnode #875

Open
Gastonite opened this issue Feb 20, 2019 · 2 comments
Open

Pre-existing style attribute is removed from vnode #875

Gastonite opened this issue Feb 20, 2019 · 2 comments

Comments

@Gastonite
Copy link
Contributor

Gastonite commented Feb 20, 2019

Hi,

I don't understand why the style attribute disappears when a component renders a vnode that produces the same attribute value.

Code to reproduce the issue:
Edit 10oxzy2z1q

Expected behavior:
Maybe the style attribute should stay the same like with snabbdom :
Edit 10oxzy2z1q

Actual behavior:
style attribute is removed when app is started

Versions of packages used:
@cycle/dom 22.3
@cycle/run 5.2

@Gastonite
Copy link
Contributor Author

Gastonite commented Feb 21, 2019

Ok, it only happens when the root element is minified.

This works:

<div class="root">
  <div style="color: green">he</div>
</div>

Defined in one line, it removes the style attribute:

<div class="root"><div style="color: green">he</div></div>

@Gastonite Gastonite changed the title Style module does not see the pre-existing style attribute Pre-existing style attribute is removed from vnode Feb 21, 2019
@Gastonite
Copy link
Contributor Author

Gastonite commented May 31, 2019

Got it!
The problem is resolved when AttrsModule is loaded before StyleModule:

Edit infallible-pascal-do0er

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants