Skip to content

Commit 2e3fd91

Browse files
author
Tanner Reits
committed
fix(segment, segment-view): disabled state linking
1 parent 7ddacf1 commit 2e3fd91

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

core/src/components/segment-button/segment-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class SegmentButton implements ComponentInterface, ButtonInterface {
4444
/**
4545
* If `true`, the user cannot interact with the segment button.
4646
*/
47-
@Prop({ mutable: true }) disabled = false;
47+
@Prop({ mutable: true, reflect: true }) disabled = false;
4848

4949
/**
5050
* Set the layout of the text and icon in the segment.

core/src/components/segment/segment.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,13 @@ export class Segment implements ComponentInterface {
157157
disabledChanged() {
158158
this.gestureChanged();
159159

160-
const buttons = this.getButtons();
161-
for (const button of buttons) {
162-
button.disabled = this.disabled;
160+
if (!this.segmentViewEl) {
161+
const buttons = this.getButtons();
162+
for (const button of buttons) {
163+
button.disabled = this.disabled;
164+
}
165+
} else {
166+
this.segmentViewEl.disabled = this.disabled;
163167
}
164168
}
165169

0 commit comments

Comments
 (0)