Changes to one form item in a dom-repeat gets copied to the bottom item

44 views
Skip to first unread message

Nate Thompson

unread,
Sep 8, 2015, 1:44:32 PM9/8/15
to Polymer
In the web component below, if I make to entries by clicking add twice then change the upper entry, the change to the upper entry gets copied to the bottom one.  Am I doing something wrong, or is this a bug?

<link rel="import" href="/components/polymer/polymer.html">
<link rel="import" href="/components/paper-button/paper-button.html">
<link rel="import" href="/components/paper-input/paper-input.html">

<dom-module id="medatest-test">
  <template>
    <paper-button on-click="_addClicked">Add</paper-button>
    <template is="dom-repeat" items="{{data}}">
      <paper-input value="{{item}}"></paper-input>
    </template>
  </template>
  <script>
    Polymer({
      is: "medatest-test",
      properties: {
        data: Array,
      },
      attached: function() {
        this.data = [ ];
      },
      _addClicked: function(e) {
        this.push("data", null);
      },
    });
  </script>
</dom-module>

Thanks,
Nate
Reply all
Reply to author
Forward
0 new messages