Commit e92e0b6 1 parent 1f33928 commit e92e0b6 Copy full SHA for e92e0b6
File tree 1 file changed +10
-2
lines changed
frontend/src/container/NewDashboard/DashboardVariablesSelection
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,13 @@ function VariableItem({
157
157
} else {
158
158
[ value ] = newOptionsData ;
159
159
}
160
+ } else if ( variableData . multiSelect ) {
161
+ const { selectedValue } = variableData ;
162
+ allSelected =
163
+ newOptionsData . length > 0 &&
164
+ Array . isArray ( selectedValue ) &&
165
+ selectedValue . length === newOptionsData . length &&
166
+ newOptionsData . every ( ( option ) => selectedValue . includes ( option ) ) ;
160
167
}
161
168
162
169
if ( variableData && variableData ?. name && variableData ?. id ) {
@@ -235,8 +242,9 @@ function VariableItem({
235
242
} ,
236
243
) ;
237
244
238
- const handleChange = ( value : string | string [ ] ) : void => {
239
- // if value is equal to selected value then return
245
+ const handleChange = ( inputValue : string | string [ ] ) : void => {
246
+ const value = variableData . multiSelect && ! inputValue ? [ ] : inputValue ;
247
+
240
248
if (
241
249
value === variableData . selectedValue ||
242
250
( Array . isArray ( value ) &&
You can’t perform that action at this time.
0 commit comments