Skip to content

The open alternative to Salesforce, designed for AI.

fix-right-drawer-bounces-when-opening-a-different-thread (#3691)

bosiraphael3a480f150646
diff --git a/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawer.tsx b/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawer.tsx
index 6266ad045b8..2ec927823f5 100644
--- a/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawer.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/right-drawer/components/RightDrawer.tsx
@@ -83,14 +83,23 @@ export const RightDrawer = () => {
return <></>;
}
+ const variants = {
+ fullScreen: {
+ width: '100%',
+ },
+ normal: {
+ width: rightDrawerWidth,
+ },
+ closed: {
+ width: 0,
+ },
+ };
+
return (
<StyledContainer
- initial={{
- width: 0,
- }}
- animate={{
- width: rightDrawerWidth,
- }}
+ initial="closed"
+ animate={isRightDrawerOpen ? 'normal' : 'closed'}
+ variants={variants}
transition={{
duration: theme.animation.duration.normal,
}}