mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 04:59:17 +08:00
contextmenu 位置优化一下
This commit is contained in:
parent
4791f4f5d7
commit
859d5b950c
@ -85,6 +85,13 @@ export class ContextMenu extends React.Component<
|
||||
info: {x: number; y: number; align?: 'left' | 'right'},
|
||||
menus: Array<MenuItem>
|
||||
) {
|
||||
if (info.x + 200 > window.innerWidth) {
|
||||
info.x = window.innerWidth - 200;
|
||||
info.align = 'left';
|
||||
} else if (info.x + 300 > window.innerWidth) {
|
||||
info.align = 'left';
|
||||
}
|
||||
|
||||
this.setState({
|
||||
isOpened: true,
|
||||
x: info.x,
|
||||
|
Loading…
Reference in New Issue
Block a user