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() { private _reflectAttributes() {
this._ignoreChange = true; this._ignoreChange = true;
for (const attributeName in REFLECTED_ATTRIBUTES) { for (const attributeName of REFLECTED_ATTRIBUTES) {
const attributeValue = this._input.getAttribute(attributeName); if (this._input.hasAttribute(attributeName)) {
if (attributeValue === null) continue; this.setAttribute(attributeName, this._input.getAttribute(attributeName)!);
this.setAttribute(attributeName, attributeValue); } else {
this.removeAttribute(attributeName);
}
} }
this._ignoreChange = false; this._ignoreChange = false;
} }