Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
fix(Popper): fix comparison for scrollParent (#1959)
Browse files Browse the repository at this point in the history
* fix(Popper): fix comparison for `scrollParent`

* add changelog
  • Loading branch information
layershifter authored Sep 24, 2019
1 parent 885947f commit 15db9b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

### Fixes
- Fix comparison for `scrollParent` in `unstable_Popper` @layershifter ([#1959](https://github.com/stardust-ui/react/pull/1959))

<!--------------------------------[ v0.39.0 ]------------------------------- -->
## [v0.39.0](https://github.com/stardust-ui/react/tree/v0.39.0) (2019-09-23)
[Compare changes](https://github.com/stardust-ui/react/compare/v0.38.1...v0.39.0)
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/lib/positioner/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const Popper: React.FunctionComponent<PopperProps> = props => {
}

const pointerTargetRefElement = pointerTargetRef && pointerTargetRef.current
const popperHasScrollableParent = getScrollParent(contentRef.current) !== document.body
const scrollParentElement = getScrollParent(contentRef.current)
const popperHasScrollableParent = scrollParentElement !== scrollParentElement.ownerDocument.body

const modifiers: PopperJS.Modifiers = _.merge(
{ preventOverflow: { padding: 0 } },
Expand Down

0 comments on commit 15db9b8

Please sign in to comment.