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 (!checked) {
|
||||
this.value = clicked.value;
|
||||
this.setCheckedClasses();
|
||||
}
|
||||
|
||||
// If the gesture began on the clicked button with the indicator
|
||||
@ -375,8 +376,12 @@ export class Segment implements ComponentInterface {
|
||||
const previous = this.checked;
|
||||
this.value = current.value;
|
||||
|
||||
if (previous && this.scrollable) {
|
||||
if (this.scrollable) {
|
||||
if (previous) {
|
||||
this.checkButton(previous, current);
|
||||
} else {
|
||||
this.setCheckedClasses();
|
||||
}
|
||||
}
|
||||
|
||||
this.checked = current;
|
||||
|
Reference in New Issue
Block a user