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

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

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

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

hwillson opened this issue Oct 20, 2016 · 2 comments

Comments

@hwillson
Copy link
Member

@hwillson 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
Copy link
Collaborator

@mitar mitar commented Dec 31, 2016

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

@mitar
Copy link
Collaborator

@mitar 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.