材质用户界面-弹出框跳到了视口的左上方

时间:2018-09-06 04:23:21

标签: reactjs material-ui react-big-calendar


我正在使用Big Calendar&Popover Material UI开发一个小功能。

点击日历中的事件后,弹出窗口将显示在事件底部

<Popover
    disableEnforceFocus
    open={popoverJob.show}
    anchorEl={popoverJob.target}
    onClose={() => this.hideDetailJob()}
    anchorOrigin={{
        vertical: 'bottom',
        horizontal: 'center',
    }}
    transformOrigin={{
        vertical: 'top',
        horizontal: 'center',
    }}>
    {/* Content here */}
<Popover>

一切正常,直到我应用窗口调整大小。弹出窗口跳至查看端口(浏览器)的左上方。

我发现以下日志有问题,该事件的偏移位置已重置为0(顶部0-左侧0)

==================
anchor.offsetLeft = 280
anchor.offsetTop = 117


==================
anchor.offsetLeft = 0
anchor.offsetTop = 0

如何解决这些问题?

0 个答案:

没有答案