mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(segment): ensure checked classes get set after not having a value (#21547)
This commit is contained in:
@ -213,6 +213,7 @@ export class Segment implements ComponentInterface {
|
|||||||
// If there are no checked buttons, set the current button to checked
|
// If there are no checked buttons, set the current button to checked
|
||||||
if (!checked) {
|
if (!checked) {
|
||||||
this.value = clicked.value;
|
this.value = clicked.value;
|
||||||
|
this.setCheckedClasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the gesture began on the clicked button with the indicator
|
// If the gesture began on the clicked button with the indicator
|
||||||
@ -375,8 +376,12 @@ export class Segment implements ComponentInterface {
|
|||||||
const previous = this.checked;
|
const previous = this.checked;
|
||||||
this.value = current.value;
|
this.value = current.value;
|
||||||
|
|
||||||
if (previous && this.scrollable) {
|
if (this.scrollable) {
|
||||||
this.checkButton(previous, current);
|
if (previous) {
|
||||||
|
this.checkButton(previous, current);
|
||||||
|
} else {
|
||||||
|
this.setCheckedClasses();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.checked = current;
|
this.checked = current;
|
||||||
|
Reference in New Issue
Block a user