fix: make menus scrollable when there's not enough space

This commit is contained in:
Antonella Sgarlatta
2021-05-20 16:57:34 -03:00
parent c7be130a94
commit 6a9d54c2ae
7 changed files with 89 additions and 49 deletions

View File

@@ -31,13 +31,13 @@ const NotesContextMenu = observer(({ appState }: Props) => {
return appState.notes.contextMenuOpen ? (
<div
ref={contextMenuRef}
className="sn-dropdown max-w-80 flex flex-col py-2 absolute"
style={{ ...appState.notes.contextMenuPosition }}
className="sn-dropdown max-h-120 max-w-80 flex flex-col py-2 overflow-y-scroll fixed"
style={{
...appState.notes.contextMenuPosition,
maxHeight: appState.notes.contextMenuMaxHeight,
}}
>
<NotesOptions
appState={appState}
closeOnBlur={closeOnBlur}
/>
<NotesOptions appState={appState} closeOnBlur={closeOnBlur} />
</div>
) : null;
});