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

@@ -27,6 +27,7 @@ export class NotesState {
top: 0,
left: 0,
};
contextMenuMaxHeight: number | 'auto' = 'auto';
showProtectedWarning = false;
constructor(
@@ -45,6 +46,7 @@ export class NotesState {
setContextMenuOpen: action,
setContextMenuPosition: action,
setContextMenuMaxHeight: action,
setShowProtectedWarning: action,
unselectNotes: action,
});
@@ -181,6 +183,10 @@ export class NotesState {
this.contextMenuPosition = position;
}
setContextMenuMaxHeight(maxHeight: number | 'auto'): void {
this.contextMenuMaxHeight = maxHeight;
}
async changeSelectedNotes(
mutate: (mutator: NoteMutator) => void
): Promise<void> {