googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

Consider special handler for style attribute bindings #166

Open sorvell opened 10 years ago

sorvell commented 10 years ago

When a binding in the style attribute causes the attribute to be re-written, any settings to style properties are lost. Perhaps this could be fixed by having style bindings directly update style properties rather than the attribute.

Here's an example, note that the box unexpectedly jumps up when the background data changes:

http://jsbin.com/matef/3/edit

frankiefu commented 9 years ago

In paper-progress we do style attribute binding to change the width:

<div id="activeProgress" style="width: {{ratio}}%;"></div>

An user wants to change the style of paper-progress from javascript:

this.$.prog.querySelector("::shadow #activeProgress").style.backgroundColor = 'red';

This will not work because binding in the style attribute causes the attribute to be re-written. I can workaround this in paper-progress but I just want to make a note here.