diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx index 5b6755b06..06f9274c8 100644 --- a/src/components/ContextMenu.tsx +++ b/src/components/ContextMenu.tsx @@ -85,6 +85,13 @@ export class ContextMenu extends React.Component< info: {x: number; y: number; align?: 'left' | 'right'}, menus: Array ) { + 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,