Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Fix <range-input disabled> (#195)

Jason Millera79f95b30562
diff --git a/src/custom-els/RangeInput/index.ts b/src/custom-els/RangeInput/index.ts
index fbfd7624..d6c103e6 100644
--- a/src/custom-els/RangeInput/index.ts
+++ b/src/custom-els/RangeInput/index.ts
@@ -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;
}