Skip to content

Commit 59a8c74

Browse files
fix(statuslight): disabled logic in first-gen
- moves the disabled logic to the StatusLight subclass in first-gen
1 parent 21c29d4 commit 59a8c74

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

first-gen/packages/status-light/src/StatusLight.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import {
1414
CSSResultArray,
1515
html,
16+
PropertyValues,
1617
TemplateResult,
1718
} from '@spectrum-web-components/base';
1819

@@ -88,6 +89,20 @@ export class StatusLight extends StatusLightBase {
8889
@property({ type: Boolean, reflect: true })
8990
public disabled = false;
9091

92+
// ──────────────────────
93+
// IMPLEMENTATION
94+
// ──────────────────────
95+
96+
protected override updated(changes: PropertyValues): void {
97+
super.updated(changes);
98+
if (changes.has('disabled')) {
99+
if (this.disabled) {
100+
this.setAttribute('aria-disabled', 'true');
101+
} else {
102+
this.removeAttribute('aria-disabled');
103+
}
104+
}
105+
}
91106
// ──────────────────────────────
92107
// RENDERING & STYLING
93108
// ──────────────────────────────

0 commit comments

Comments
 (0)