Popover horizontal alignment fixes

This commit is contained in:
Juan 2018-07-03 13:36:35 +02:00
parent 2b03f656c8
commit cfce618844
1 changed files with 2 additions and 2 deletions

View File

@ -136,10 +136,10 @@ export default class Popover extends Component {
let arrowHeight = Math.sqrt(Math.pow(arrowRect.height, 2) * 2) / 2;
let top = parentRect.top + parentRect.height + arrowHeight;
let left = parentRect.left;
let height = popoverRect.height;
let width = Math.max(popoverRect.width, parentRect.width);
let top = parentRect.top + parentRect.height + arrowHeight;
let left = parentRect.left + parentRect.width / 2 - width / 2;
let margin = 10;
let showTop = top + height + margin > window.innerHeight;