File tree 2 files changed +23
-6
lines changed
frontend/features/notes/components
2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,14 @@ export function setupSortContextMenu() {
90
90
] ;
91
91
92
92
const menu = Menu . buildFromTemplate ( template ) ;
93
- menu . popup ( {
94
- x,
95
- y,
96
- } ) ;
93
+
94
+ try {
95
+ menu . popup ( {
96
+ x,
97
+ y,
98
+ } ) ;
99
+ } catch ( error ) {
100
+ console . error ( "Error popping up sort context menu" , error ) ;
101
+ }
97
102
} ) ;
98
103
}
Original file line number Diff line number Diff line change @@ -23,11 +23,23 @@ export function NotesHeader() {
23
23
const headerElement = document . getElementById ( "notes-header" ) ;
24
24
if ( headerElement ) {
25
25
const rect = headerElement . getBoundingClientRect ( ) ;
26
+
27
+ const roundedRect = {
28
+ left : Math . round ( rect . left ) ,
29
+ top : Math . round ( rect . top ) ,
30
+ right : Math . round ( rect . right ) ,
31
+ bottom : Math . round ( rect . bottom ) ,
32
+ } ;
33
+
26
34
if ( activeNotebookId ) {
27
35
const notebook = await window . api . getNotebook ( activeNotebookId ) ;
28
- window . api . notebookSortContextMenu ( notebook , rect . left , rect . bottom ) ;
36
+ window . api . notebookSortContextMenu (
37
+ notebook ,
38
+ roundedRect . left + 24 ,
39
+ roundedRect . bottom ,
40
+ ) ;
29
41
} else {
30
- window . api . sortContextMenu ( rect . left , rect . bottom ) ;
42
+ window . api . sortContextMenu ( roundedRect . left + 24 , roundedRect . bottom ) ;
31
43
}
32
44
}
33
45
}
You can’t perform that action at this time.
0 commit comments