File tree 1 file changed +5
-3
lines changed
packages/main/src/components/FilterBar
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -331,12 +331,14 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
331
331
const [ updatedIndex , setUpdatedIndex ] = useState ( undefined ) ;
332
332
useEffect ( ( ) => {
333
333
if ( currentReorderedItem ?. index != null ) {
334
- setOrderedChildren ( ( prev : any [ ] ) => {
335
- const { index, direction } = currentReorderedItem ;
334
+ const { index, direction } = currentReorderedItem ;
335
+ setOrderedChildren ( ( prevChildren : ReactElement < FilterGroupItemInternalProps > [ ] ) => {
336
+ const prev = [ ...prevChildren ] ;
336
337
switch ( direction ) {
337
338
case 'up' :
338
339
if ( index > 0 ) {
339
340
setUpdatedIndex ( index - 1 ) ;
341
+
340
342
const temp = prev [ index ] ;
341
343
prev [ index ] = prev [ index - 1 ] ;
342
344
prev [ index - 1 ] = temp ;
@@ -365,7 +367,7 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
365
367
}
366
368
break ;
367
369
}
368
- return [ ... prev ] ;
370
+ return prev ;
369
371
} ) ;
370
372
void currentReorderedItem . target . focus ( ) ;
371
373
}
You can’t perform that action at this time.
0 commit comments