fix options

This commit is contained in:
zadam
2022-12-22 22:52:04 +01:00
parent a882ad41c5
commit 46f40ee534
4 changed files with 21 additions and 20 deletions

View File

@@ -369,17 +369,18 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
return false;
}
},
beforeActivate: (event, data) => {
beforeActivate: (event, {node}) => {
// hidden subtree is hidden hackily, prevent activating it e.g. by keyboard
if (hoistedNoteService.getHoistedNoteId() === '_hidden') {
// if we're hoisted in hidden subtree, we want to avoid crossing to "visible" tree,
// which could happen via UP key from hidden root (to another top level note)
return data.node.data.noteId === '_hidden' || data.node.getParent().data.noteId !== 'root';
// which could happen via UP key from hidden root
return node.data.noteId !== 'root';
}
// we're not hoisted to hidden subtree, the only way to cross is via DOWN key to the hidden root
return data.node.data.noteId !== '_hidden';
return node.data.noteId !== '_hidden';
},
activate: async (event, data) => {
// click event won't propagate so let's close context menu manually