Skip to content

Commit

Permalink
Fix jumpy modal animation on resize (#3285)
Browse files Browse the repository at this point in the history
* fix(main nav redesign): fix jumpy modal animation on resize

* chore: remove transition from stacking layer

---------

Co-authored-by: Ddouglasz <douglas.egiemeh@gmail.com>
Co-authored-by: Klaudija Ljevar <klaudija.ljevar@gmail.com>
  • Loading branch information
3 people authored Nov 29, 2023
1 parent 67bdd36 commit ceb1b74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-beds-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-components': patch
---

fix issue of jumpy modal animation on page resize
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const PortalsContainer = forwardRef<TLayoutRefs, TPortalsContainerProps>(
props.containerSelectorToPreventScrollingOnOpen ?? 'main';
const zIndex = props.zIndex ?? 10000;
const baseModalZIndex = props.baseModalZIndex ?? 1000;
const modalWidthTransition = 'width 150ms cubic-bezier(1, 0, 0.58, 1)';

const portalsContainerRef = useRef<HTMLDivElement>(null);
const globalNotificationsElementDimensions = useObserverElementDimensions(
Expand Down Expand Up @@ -188,10 +189,12 @@ const PortalsContainer = forwardRef<TLayoutRefs, TPortalsContainerProps>(
right: 0;
bottom: 0;
z-index: ${zIndex};
transition: ${modalWidthTransition};
}
.ReactModal__Body--open.body__menu-open #${PORTALS_CONTAINER_ID} {
width: calc(100% - ${offsetLeftOnExpandedMenu});
transition: ${modalWidthTransition};
}
`,
// Apply styles for stacking layers.
Expand Down

2 comments on commit ceb1b74

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for merchant-center-application-kit ready!

✅ Preview
https://merchant-center-application-g7r520jet-commercetools.vercel.app

Built with commit ceb1b74.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for application-kit-custom-views ready!

✅ Preview
https://application-kit-custom-views-hwyv29ba1-commercetools.vercel.app

Built with commit ceb1b74.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.