fix: make context menu scrollable when there's not enough space

This commit is contained in:
Antonella Sgarlatta
2021-05-20 13:29:59 -03:00
parent eea4f98928
commit f9f2959ad5
3 changed files with 51 additions and 9 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(height: number | 'auto'): void {
this.contextMenuMaxHeight = height;
}
async changeSelectedNotes(
mutate: (mutator: NoteMutator) => void
): Promise<void> {