mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 09:39:15 +00:00
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:
committed by
Jake Archibald
parent
49b40b1c3e
commit
a79f95b305
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user