cyclejs icon indicating copy to clipboard operation
cyclejs copied to clipboard

Pre-existing style attribute is removed from vnode

Open Gastonite opened this issue 6 years ago • 2 comments

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 avatar Feb 20 '19 19:02 Gastonite

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 avatar Feb 21 '19 22:02 Gastonite

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

Edit infallible-pascal-do0er

Gastonite avatar May 31 '19 03:05 Gastonite