PolymerElements / paper-button

A button à la Material Design
https://www.webcomponents.org/element/PolymerElements/paper-button
138 stars 64 forks source link

Creating paper-button programmatically does not realize content #33

Closed kennyjwilli closed 9 years ago

kennyjwilli commented 9 years ago

As the title says, when you create a paper-button programmatically the button does not realize its content. It will not center the text and the iron-icon rendered inside the paper-button does not appear.

<!doctype html>
<html lang="">
<head>
  <title>sandbox</title>

  <link rel="import" href="bower_components/polymer/polymer.html">

  <link rel="import" href="bower_components/paper-button/paper-button.html">
  <link rel="import" href="bower_components/iron-icon/iron-icon.html">
  <link rel="import" href="bower_components/iron-icons/iron-icons.html">

</head>

<body unresolved class="fullbleed">

  <paper-button>
    <iron-icon icon="send"></iron-icon>
    Test
  </paper-button>
  <script type="text/javascript">
    var btn = document.createElement("paper-button");
    var icon = document.createElement("iron-icon");
    icon.icon = "send";
    btn.appendChild(icon);
    btn.innerHTML = btn.innerHTML + "new";
    document.body.appendChild(btn);
  </script>
</body>
</html>