Skip to content

Commit

Permalink
refactor(FloatingMenu): ignore scroll position for non static elements
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Nov 30, 2020
1 parent b29724f commit 723eb82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/internal/FloatingMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ const getFloatingPosition = ({
right: refRight = 0,
bottom: refBottom = 0,
} = refPosition;
const scrollX = container.position === 'sticky' ? 0 : pageXOffset;
const scrollY = container.position === 'sticky' ? 0 : pageYOffset;
const scrollX = container.position !== 'static' ? 0 : pageXOffset;
const scrollY = container.position !== 'static' ? 0 : pageYOffset;
const relativeDiff = {
top: container.position !== 'static' ? container.rect.top : 0,
left: container.position !== 'static' ? container.rect.left : 0,
Expand Down

0 comments on commit 723eb82

Please sign in to comment.