Error "Found 3 elements with non-unique id #input"

user3197506 picture user3197506 · Dec 18, 2017 · Viewed 22.9k times · Source

I'm using Polymer with Chrome 63.0.3239.108 (updated this morning) and I got some new errors while launching my webapp:

[DOM] Found 3 elements with non-unique id #input

Here's my code :

<div class="card-content" on-keypress="_keyHandler">
   <paper-input id="login" label="[[i18n('uid')]]"></paper-input>
   <paper-input id="pwd" label="[[i18n('pwd')]]" type="password"></paper-input>
   <paper-input id="server" label="[[i18n('server')]]"></paper-input>
</div>

Yeah, <paper-input> elements have the same id, but what can I do to remove this console error?

Thanks a lot

Answer

Wahap picture Wahap · Dec 27, 2017

I had same issue when i was using angular 5. I put "name" attribute into my tags and it fixed.

Like:

<input type="text" [(ngModel)]="user.userName"  name="loginUserName" >