fix: open menu to the top when at the bottom of the screen

This commit is contained in:
Antonella Sgarlatta
2021-05-07 18:35:02 -03:00
parent 437aa40d7a
commit 24eb348b08
3 changed files with 18 additions and 8 deletions

View File

@@ -6,7 +6,6 @@ import {
SNNote,
NoteMutator,
ContentType,
SNTag,
} from '@standardnotes/snjs';
import {
makeObservable,
@@ -23,7 +22,7 @@ export class NotesState {
lastSelectedNote: SNNote | undefined;
selectedNotes: Record<UuidString, SNNote> = {};
contextMenuOpen = false;
contextMenuPosition: { top: number; left: number } = { top: 0, left: 0 };
contextMenuPosition: { top?: number; left: number, bottom?: number } = { top: 0, left: 0 };
constructor(
private application: WebApplication,
@@ -162,7 +161,7 @@ export class NotesState {
this.contextMenuOpen = open;
}
setContextMenuPosition(position: { top: number; left: number }): void {
setContextMenuPosition(position: { top?: number; left: number, bottom?: number }): void {
this.contextMenuPosition = position;
}