File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/main/src/components/FilterBar Expand file tree Collapse file tree 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) => {
331331 const [ updatedIndex , setUpdatedIndex ] = useState ( undefined ) ;
332332 useEffect ( ( ) => {
333333 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 ] ;
336337 switch ( direction ) {
337338 case 'up' :
338339 if ( index > 0 ) {
339340 setUpdatedIndex ( index - 1 ) ;
341+
340342 const temp = prev [ index ] ;
341343 prev [ index ] = prev [ index - 1 ] ;
342344 prev [ index - 1 ] = temp ;
@@ -365,7 +367,7 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
365367 }
366368 break ;
367369 }
368- return [ ... prev ] ;
370+ return prev ;
369371 } ) ;
370372 void currentReorderedItem . target . focus ( ) ;
371373 }
You can’t perform that action at this time.
0 commit comments