Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #45 from kylegach/master
Browse files Browse the repository at this point in the history
Fix missing data-x-out-of-boundaries attribute
  • Loading branch information
souporserious authored Sep 22, 2017
2 parents 53fd32b + ae6221d commit 81ff21e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Popper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ class Popper extends Component {
return !!this.state.data ? this.state.data.placement : undefined
}

_getPopperHide = () => {
return !!this.state.data && this.state.data.hide ? '' : undefined
}

_getArrowStyle = () => {
if (!this.state.data || !this.state.data.offsets.arrow) {
return {}
Expand Down Expand Up @@ -175,12 +179,14 @@ class Popper extends Component {
}
const popperStyle = this._getPopperStyle()
const popperPlacement = this._getPopperPlacement()
const popperHide = this._getPopperHide()

if (typeof children === 'function') {
const popperProps = {
ref: popperRef,
style: popperStyle,
['data-placement']: popperPlacement,
['data-x-out-of-boundaries']: popperHide,
}
return children({
popperProps,
Expand All @@ -196,6 +202,7 @@ class Popper extends Component {
...popperStyle,
},
'data-placement': popperPlacement,
'data-x-out-of-boundaries': popperHide,
}

if (typeof component === 'string') {
Expand Down

0 comments on commit 81ff21e

Please sign in to comment.