mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
ensure contextMenu doesn't overflow viewport (#364)
This commit is contained in:
parent
d2a3ed7931
commit
8104c8525d
2 changed files with 35 additions and 4 deletions
|
@ -18,7 +18,12 @@ type Props = {
|
|||
|
||||
function ContextMenu({ options, onCloseRequest, top, left }: Props) {
|
||||
return (
|
||||
<Popover onCloseRequest={onCloseRequest} top={top} left={left}>
|
||||
<Popover
|
||||
onCloseRequest={onCloseRequest}
|
||||
top={top}
|
||||
left={left}
|
||||
fitInViewport={true}
|
||||
>
|
||||
<ul className="context-menu" onContextMenu={e => e.preventDefault()}>
|
||||
{options.map((option, idx) => (
|
||||
<li
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue