@@ -74,10 +74,12 @@ export class AccordionGroup implements ComponentInterface {
7474 @Event ( ) ionValueChange ! : EventEmitter < AccordionGroupChangeEventDetail > ;
7575
7676 private hasEmittedInitialValue = false ;
77+ private isUserInitiatedChange = false ;
7778
7879 @Watch ( 'value' )
7980 valueChanged ( ) {
80- this . emitValueChange ( false ) ;
81+ this . emitValueChange ( false , this . isUserInitiatedChange ) ;
82+ this . isUserInitiatedChange = false ;
8183 }
8284
8385 @Watch ( 'disabled' )
@@ -179,6 +181,7 @@ export class AccordionGroup implements ComponentInterface {
179181 * accordion group to an array.
180182 */
181183 private setValue ( accordionValue : string | string [ ] | null | undefined ) {
184+ this . isUserInitiatedChange = true ;
182185 const value = ( this . value = accordionValue ) ;
183186 this . ionChange . emit ( { value } ) ;
184187 }
@@ -255,7 +258,7 @@ export class AccordionGroup implements ComponentInterface {
255258 return Array . from ( this . el . querySelectorAll ( ':scope > ion-accordion' ) ) as HTMLIonAccordionElement [ ] ;
256259 }
257260
258- private emitValueChange ( initial : boolean ) {
261+ private emitValueChange ( initial : boolean , isUserInitiated = false ) {
259262 const { value, multiple } = this ;
260263
261264 if ( ! multiple && Array . isArray ( value ) ) {
@@ -280,7 +283,7 @@ export class AccordionGroup implements ComponentInterface {
280283 * Track if this is the initial value update so accordions
281284 * can skip transition animations when they first render.
282285 */
283- const shouldMarkInitial = initial || ( ! this . hasEmittedInitialValue && value !== undefined ) ;
286+ const shouldMarkInitial = initial || ( ! this . hasEmittedInitialValue && value !== undefined && ! isUserInitiated ) ;
284287
285288 this . ionValueChange . emit ( { value, initial : shouldMarkInitial } ) ;
286289
0 commit comments