File tree Expand file tree Collapse file tree
packages/autocomplete-core/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,13 +54,13 @@ export function onInput<TItem extends BaseItem>({
5454 setActiveItemId ( props . defaultActiveItemId ) ;
5555
5656 if ( ! query && props . openOnFocus === false ) {
57- const newCollections = store . getState ( ) . collections . map ( ( collection ) => ( {
57+ const collections = store . getState ( ) . collections . map ( ( collection ) => ( {
5858 ...collection ,
5959 items : [ ] ,
6060 } ) ) ;
6161
6262 setStatus ( 'idle' ) ;
63- setCollections ( newCollections ) ;
63+ setCollections ( collections ) ;
6464 setIsOpen (
6565 nextState . isOpen ?? props . shouldPanelOpen ( { state : store . getState ( ) } )
6666 ) ;
@@ -69,9 +69,7 @@ export function onInput<TItem extends BaseItem>({
6969 // promises to keep late resolving promises from "cancelling" the state
7070 // updates performed in this code path.
7171 // We chain with a void promise to respect `onInput`'s expected return type.
72- return runConcurrentSafePromise ( newCollections ) . then ( ( ) =>
73- Promise . resolve ( )
74- ) ;
72+ return runConcurrentSafePromise ( collections ) . then ( ( ) => Promise . resolve ( ) ) ;
7573 }
7674
7775 setStatus ( 'loading' ) ;
You can’t perform that action at this time.
0 commit comments