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

Fix missing data-x-out-of-boundaries attribute #45

Merged
merged 1 commit into from
Sep 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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