Skip to content

Commit

Permalink
fix: remove transform to maintain fixed positioning in child elements (
Browse files Browse the repository at this point in the history
…#1006)

* fix: remove transform to maintain fixed positioning in child elements
* fix: add fix explanatory comment
  • Loading branch information
felix-ico authored Apr 27, 2022
1 parent 8724bfc commit 2fea224
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/components/src/utils/animate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,18 @@ export const KEYFRAMES = {
offset: 0,
...keyframeDefaults,
opacity: 0,
transform: 'translateY(-3rem)',
/**
* we are not using transform here to avoid breaking positioning for nested fixed elements (i.e. a flyout menu in an animated modal)
* see 'fixed' section @link https://developer.mozilla.org/en-US/docs/Web/CSS/position
*/

top: '-3rem',
},
{
offset: 1,
...keyframeDefaults,
opacity: 1,
transform: 'translateY(0)',
top: 0,
},
],
};

0 comments on commit 2fea224

Please sign in to comment.