Popover horizontal alignment fixes
This commit is contained in:
parent
2b03f656c8
commit
cfce618844
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue