-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
IE8 'movesWhitespace' issue #3650
Comments
You should be using bindAttr, not {{if}} statements for attributes. |
Hmm, check, that solves it in this case. Thanks! Offtopic, it a shame (imho): <span {{bind-attr class="active_index:active:otherstatus :anotherClass :extra"}}>TEST1</span> is not really intiutive (for frontenders, using ember.js for protoyping). IF/else logic with ":" seperators. Prepending static classes with ":"... I do get the need for bind-attr though, as Handlebars is not context aware (prevent script-tag output) See here: http://jsfiddle.net/gavro/3EwXR/4/ |
The basic reason that you cannot use if/else within tags (as you originally had) is that Handlebars uses metamorph tags to surround dynamic segments and know what needs to be changed/updated. There is definitely a plan to remove this limitation (https://github.com/tildeio/htmlbars), but there is no timeline that I am aware of. |
@gavro i believe this is a handlebars thing: handlebars-lang/handlebars.js#336 |
I've been having problems with your movesWhiteSpace check & fix, and it seems it might be just your findChildByID function, which is not returning anything.
You can find a reproduction of the bug here: http://jsfiddle.net/3EwXR/3/
To reproduce this with your own code, just try adding a conditional like this:
You NEED the spaces between }} [class_name] {{
--> this conditional is simply not working:
(Could someone maybe explain why you need to add spaces here?)
So you've got the following code (r18534):
--> your comment @ findChildByID: // Use this to find children by ID instead of using jQuery
If you change the above code to this (using jQuery find) it seems to be working:
Whan applying this new code: the page get's rendered. But the active state is NOT applied. Your whiteSpaceFix removes the trailing space, so you get:
...which again, is not working.
To get this completely working in IE8, I need to disable the whitespace fix completely:
Any thoughts on this?
The text was updated successfully, but these errors were encountered: