Skip to content

Commit

Permalink
Merge pull request #38 from yashhy/fix-popup-arrowStyle-css-property-…
Browse files Browse the repository at this point in the history
…left-is-been-overridden

fix issue #36 popup arrowStyle css property "left" is been overridden
  • Loading branch information
yjose authored Sep 29, 2018
2 parents b3187a0 + 4c4af3c commit cfcdb08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/src/markdown/componentApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ The reactjs-popup API is inspired by semantic popup docs
| onOpen | | {func} | function called on open event |
| onClose | | {func} | function called on close event |
| contentStyle | | {object} | Custom popup content style |
| overlayStyle | | {object} | Custom overlay style |
| arrowStyle | | {object} | Custom arrow style |
| overlayStyle | | {object} | Custom overlay style <br/> Note: `top` and `left` property will not be overridden. |
| arrowStyle | | {object} | Custom arrow style <br/> Note: `transform` property will not be overridden. |
| keepTooltipInside | | {bool,string} | html selector, class name or id element that the tooltip must be inside (defaults to `window` if keepTooltipInside = true) default false |

### Example : on focus
Expand Down
6 changes: 3 additions & 3 deletions src/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default class Popup extends React.PureComponent {
};

setPosition = () => {
const { arrow, position, offsetX, offsetY, keepTooltipInside } = this.props;
const { arrow, position, offsetX, offsetY, keepTooltipInside, arrowStyle } = this.props;
const { modal } = this.state;
if (modal) return;
const helper = this.HelperEl.getBoundingClientRect();
Expand Down Expand Up @@ -168,8 +168,8 @@ export default class Popup extends React.PureComponent {
this.ArrowEl.style["transform"] = cords.transform;
this.ArrowEl.style["-ms-transform"] = cords.transform;
this.ArrowEl.style["-webkit-transform"] = cords.transform;
this.ArrowEl.style.top = cords.arrowTop;
this.ArrowEl.style.left = cords.arrowLeft;
this.ArrowEl.style.top = arrowStyle.top || cords.arrowTop;
this.ArrowEl.style.left = arrowStyle.left || cords.arrowLeft;
}
if (
window
Expand Down

0 comments on commit cfcdb08

Please sign in to comment.