@@ -906,8 +906,6 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
906906 // Safari may click after Ctrl+click opens settings; suppress that selection until the picker reopens.
907907 const suppressNextScopeChangeRef = useRef ( false ) ;
908908 const highlightedProjectScopeKeyRef = useRef < string | null > ( null ) ;
909- // A toggle picks without closing; the combobox requests a close right after the pick.
910- const keepProjectScopeMenuOpenRef = useRef ( false ) ;
911909 // Hold dropped rows until server placement is confirmed; block another pickup from replacing the hold.
912910 const [ optimisticDrop , setOptimisticDrop ] = useState < SidebarOptimisticDrop | null > ( null ) ;
913911 const threadSearchInputRef = useRef < HTMLInputElement > ( null ) ;
@@ -2729,11 +2727,8 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
27292727 itemToStringLabel = { ( item ) => item . label }
27302728 isItemEqualToValue = { ( a , b ) => a . value === b . value }
27312729 open = { projectScopeMenuState . open }
2732- onOpenChange = { ( open ) => {
2733- if ( ! open && keepProjectScopeMenuOpenRef . current ) {
2734- keepProjectScopeMenuOpenRef . current = false ;
2735- return ;
2736- }
2730+ onOpenChange = { ( open , eventDetails ) => {
2731+ if ( eventDetails . isCanceled ) return ;
27372732 if ( open ) suppressNextScopeChangeRef . current = false ;
27382733 dispatchProjectScopeMenu ( { type : "open-changed" , open } ) ;
27392734 } }
@@ -2753,7 +2748,8 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
27532748 eventDetails . event instanceof MouseEvent &&
27542749 eventDetails . event . shiftKey
27552750 ) {
2756- keepProjectScopeMenuOpenRef . current = true ;
2751+ // Canceling skips Base UI's commit, which would freeze the search query, and its close.
2752+ eventDetails . cancel ( ) ;
27572753 toggleProjectScopeKey ( item . value ) ;
27582754 } else {
27592755 setProjectScopeKeys ( [ item . value ] ) ;
0 commit comments