Fix <range-input disabled> (#195)

* Fix .disabled property reflection for range-input (only attribute worked previously)

* Revert "Fix .disabled property reflection for range-input (only attribute worked previously)"

This reverts commit f5964635b2.

* Fix reflection

* Use hasAttribute()
This commit is contained in:
Jason Miller
2018-10-20 06:51:30 -05:00
committed by Jake Archibald
parent 49b40b1c3e
commit a79f95b305

View File

@@ -80,10 +80,12 @@ class RangeInputElement extends HTMLElement {
private _reflectAttributes() {
this._ignoreChange = true;
for (const attributeName in REFLECTED_ATTRIBUTES) {
const attributeValue = this._input.getAttribute(attributeName);
if (attributeValue === null) continue;
this.setAttribute(attributeName, attributeValue);
for (const attributeName of REFLECTED_ATTRIBUTES) {
if (this._input.hasAttribute(attributeName)) {
this.setAttribute(attributeName, this._input.getAttribute(attributeName)!);
} else {
this.removeAttribute(attributeName);
}
}
this._ignoreChange = false;
}