Missing semi-colon when new style rule is added #141

Closed
hwillson opened this Issue Oct 20, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@hwillson
Member

hwillson commented Oct 20, 2016

Migrating this confirmed bug (has a workaround) over from meteor/meteor#4681 (reported by @peernohell).


In a DOM element, if you have a rule with a value that are conditioned by a helper and this helper return an empty value, the rule is removed. But if the value reactively change the rule is append in the end of the style attribute. But if it didn't finish by a semi colon, Balze didn't add it and the style is brocken.

For an exemple you can see this meteorpad: http://meteorpad.com/pad/r4FyvBwHryBWkK9vm/Leaderboard

Some detail:
the template:

<div id="logo" style="background-color:{{bgColor}};padding: 10px">change my color</div>

The DOM after loading:

<div id="logo" style="padding: 10px">change my color</div>

The DOM after clicking a buton that change {{bgColor}} to red:

<div id="logo" style="padding: 10px background-color:red;">change my color</div>
@mitar

This comment has been minimized.

Show comment
Hide comment
@mitar

mitar Dec 31, 2016

Collaborator

As a consequence of fixing this issue order inside inline style and class attributes is now preserved.

Collaborator

mitar commented Dec 31, 2016

As a consequence of fixing this issue order inside inline style and class attributes is now preserved.

@mitar

This comment has been minimized.

Show comment
Hide comment
@mitar

mitar Dec 31, 2016

Collaborator

Now that order is preserved, it is unclear if it can happen that ; is missing inside inline styles. There is a TODO for that in joinValues method but I would need an example test case for it to fail to see how it fails.

Collaborator

mitar commented Dec 31, 2016

Now that order is preserved, it is unclear if it can happen that ; is missing inside inline styles. There is a TODO for that in joinValues method but I would need an example test case for it to fail to see how it fails.

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