21427: set last menu item to change only after transition Arvados-DCO-1.1-Signed...
[arvados.git] / services / workbench2 / src / components / multiselect-toolbar / ms-toolbar-overflow-wrapper.tsx
index 1f683b60131cfce45fa105a668a4e31b995a3ac8..47b019e0ff2200fa2865928a0a3657d726d44c2e 100644 (file)
@@ -38,6 +38,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 type WrapperProps = {
     children: OverflowChild[];
     menuLength: number;
+    isTransitioning: boolean;
 };
 
 export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperProps & WithStyles<CssRules>) => {
@@ -63,7 +64,7 @@ export const IntersectionObserverWrapper = withStyles(styles)((props: WrapperPro
         setVisibilityMap((prev) => ({
             ...prev,
             ...updatedEntries,
-            [lastEntryId]: Object.keys(updatedEntries)[0] === lastEntryId,
+            [lastEntryId]: !props.isTransitioning && Object.keys(updatedEntries)[0] === lastEntryId,
         }));
     };