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 @@ -310,12 +310,14 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
310310
311311 useEffect ( ( ) => {
312312 if ( currentReorderedItem ?. index != null ) {
313- setOrderedChildren ( ( prev : any [ ] ) => {
314- const { index, direction } = currentReorderedItem ;
313+ const { index, direction } = currentReorderedItem ;
314+ setOrderedChildren ( ( prevChildren : ReactElement < FilterGroupItemInternalProps > [ ] ) => {
315+ const prev = [ ...prevChildren ] ;
315316 switch ( direction ) {
316317 case 'up' :
317318 if ( index > 0 ) {
318319 setUpdatedIndex ( index - 1 ) ;
320+
319321 const temp = prev [ index ] ;
320322 prev [ index ] = prev [ index - 1 ] ;
321323 prev [ index - 1 ] = temp ;
@@ -344,7 +346,7 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
344346 }
345347 break ;
346348 }
347- return [ ... prev ] ;
349+ return prev ;
348350 } ) ;
349351 void currentReorderedItem . target . focus ( ) ;
350352 }
You can’t perform that action at this time.
0 commit comments