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

[2.0-preview] compound bindings throw in Safari 10. #4216

Closed
blasten opened this issue Dec 12, 2016 · 4 comments
Closed

[2.0-preview] compound bindings throw in Safari 10. #4216

blasten opened this issue Dec 12, 2016 · 4 comments

Comments

@blasten
Copy link
Contributor

blasten commented Dec 12, 2016

The following should repro the issue:

<dom-module id="x-grid">
  <template is="dom-repeat" items="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]">
    <li class="item" style="background-image: url(//lorempixel.com/800/800/nature/?i=[[item]]);">
      <div class="item-title">Nature [[item]]</div>
    </li>
  </template>
</dom-module>
<script>
  HTMLImports.whenReady(function() {
    Polymer({
      is: 'x-grid'
    });
  });
</script>

Safari 10 under Shady DOM.

Error: _atEndOfMicrotask — data:text/javascript;charset=utf-8,%0A…%0A:51TypeError: Attempted to assign to readonly property.

@sorvell
Copy link
Contributor

sorvell commented Dec 13, 2016

Attribute binding for style should work. Here's an example:

http://jsbin.com/dazonac/edit?html,output

@blasten
Copy link
Contributor Author

blasten commented Dec 13, 2016

You can see the issue here: http://jsbin.com/gixeji/edit?html,output in Safari 10.

@sorvell
Copy link
Contributor

sorvell commented Dec 13, 2016

The binding to style must be an attribute binding. In the example above, it's a property binding.

e.g.

style="background-image: ...

must be

style$="background-image: ...

@blasten
Copy link
Contributor Author

blasten commented Dec 13, 2016

@sorvell Sorry. That was the actual difference between your jsbin and mine. Would 2.0 support property binding to style? I was under the impression that bindings to style (as a property) should originate individual el.style[cssPropName] = ... updates.

@blasten blasten closed this as completed Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants