File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/components/fields/FilterPicker Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -943,11 +943,12 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
943943 } ) ;
944944
945945 useEffect ( ( ) => {
946- // Allow initial positioning & flipping when opening, then lock placement after first frame
946+ // Allow initial positioning & flipping when opening, then lock placement after transition
947+ // Popover transition is ~120ms, give it a bit more time to finalize placement
947948 if ( state . isOpen ) {
948949 setShouldUpdatePosition ( true ) ;
949- const id = requestAnimationFrame ( ( ) => setShouldUpdatePosition ( false ) ) ;
950- return ( ) => cancelAnimationFrame ( id ) ;
950+ const id = window . setTimeout ( ( ) => setShouldUpdatePosition ( false ) , 160 ) ;
951+ return ( ) => window . clearTimeout ( id ) ;
951952 } else {
952953 setShouldUpdatePosition ( true ) ;
953954 }
@@ -1038,7 +1039,7 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
10381039 placement = "bottom start"
10391040 styles = { triggerStyles }
10401041 shouldUpdatePosition = { shouldUpdatePosition }
1041- shouldFlip = { shouldFlip && ! isPopoverOpen }
1042+ shouldFlip = { shouldFlip && shouldUpdatePosition }
10421043 isDismissable = { true }
10431044 shouldCloseOnInteractOutside = { ( el ) => {
10441045 const menuTriggerEl = el . closest ( '[data-popover-trigger]' ) ;
You can’t perform that action at this time.
0 commit comments