Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ class App extends React.Component {

| Property | Description |
|----------------|---------------|
| toggle | Open or hide popover tooltip |
| toggle | Open or hide popover tooltip and returns the state of the modal |
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ class PopoverTooltip extends React.PureComponent<Props, State> {
? pageY - tooltipContainerHeight - 20
: pageY + tooltipContainerHeight - 20;
let tooltipTriangleDown = this.state.tooltipTriangleDown;

if( tooltipContainerX_final < 0 ) {
tooltipContainerX_final = 0;
}
if (pageY - tooltipContainerHeight - 20 < 0) {
tooltipContainerY_final = pageY + height + 20;
tooltipTriangleDown = false;
Expand Down Expand Up @@ -437,6 +441,7 @@ class PopoverTooltip extends React.PureComponent<Props, State> {
} else {
this.openModal();
}
return this.state.isModalOpen;
}

}
Expand Down