You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/src/components/accordion-group/accordion-group.tsx
+32-29Lines changed: 32 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -75,31 +75,7 @@ export class AccordionGroup implements ComponentInterface {
75
75
76
76
@Watch('value')
77
77
valueChanged(){
78
-
const{ value, multiple }=this;
79
-
80
-
if(!multiple&&Array.isArray(value)){
81
-
/**
82
-
* We do some processing on the `value` array so
83
-
* that it looks more like an array when logged to
84
-
* the console.
85
-
* Example given ['a', 'b']
86
-
* Default toString() behavior: a,b
87
-
* Custom behavior: ['a', 'b']
88
-
*/
89
-
printIonWarning(
90
-
`[ion-accordion-group] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".
91
-
92
-
Value Passed: [${value.map((v)=>`'${v}'`).join(', ')}]
93
-
`,
94
-
this.el
95
-
);
96
-
}
97
-
98
-
/**
99
-
* Do not use `value` here as that will be
100
-
* not account for the adjustment we make above.
101
-
*/
102
-
this.ionValueChange.emit({value: this.value});
78
+
this.emitValueChange(false);
103
79
}
104
80
105
81
@Watch('disabled')
@@ -184,11 +160,10 @@ export class AccordionGroup implements ComponentInterface {
184
160
* it is possible for the value to be set after the Web Component
185
161
* initializes but before the value watcher is set up in Stencil.
186
162
* As a result, the watcher callback may not be fired.
187
-
* We work around this by manually calling the watcher
188
-
* callback when the component has loaded and the watcher
189
-
* is configured.
163
+
* We work around this by manually emitting a value change when the component
164
+
* has loaded and the watcher is configured.
190
165
*/
191
-
this.valueChanged();
166
+
this.emitValueChange(true);
192
167
}
193
168
194
169
/**
@@ -276,6 +251,34 @@ export class AccordionGroup implements ComponentInterface {
`[ion-accordion-group] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".
268
+
269
+
Value Passed: [${value.map((v)=>`'${v}'`).join(', ')}]
270
+
`,
271
+
this.el
272
+
);
273
+
}
274
+
275
+
/**
276
+
* Do not use `value` here as that will not account
0 commit comments