Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions paper-input-container.html
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,21 @@
},

attached: function() {
if (this.attrForValue) {
this._inputElement.addEventListener(this._valueChangedEvent, this._boundValueChanged);
} else {
this.addEventListener('input', this._onInput);
if (!this._listenersAttached) {
if (this.attrForValue) {
this._inputElement.addEventListener(this._valueChangedEvent, this._boundValueChanged);
} else {
this.addEventListener('input', this._onInput);
}

if (this._inputElement) {
this._htmlInput = this._inputElement;
if (this._inputElement.nodeName === 'IRON-INPUT') {
this._htmlInput = this._inputElement.inputElement;
}
}
this._htmlInput.addEventListener("keyup", (e) => this._handleValue(this._inputElement));
this._listenersAttached = true;
}

// Only validate when attached if the input already has a value.
Expand Down Expand Up @@ -588,7 +599,7 @@
var value = this._inputElementValue;

// type="number" hack needed because this.value is empty until it's valid
if (value || value === 0 || (inputElement.type === 'number' && !inputElement.checkValidity())) {
if (value || value === 0 || ( this._htmlInput.type === 'number' && !this._htmlInput.checkValidity())) {
this._inputHasContent = true;
} else {
this._inputHasContent = false;
Expand Down