mirror of
https://github.com/zadam/trilium.git
synced 2025-11-28 19:44:24 +01:00
fix(left-pane): only focus the note when toggling left pane visibility if necessary
This commit is contained in:
parent
407cac588a
commit
648ab4d736
@ -29,7 +29,11 @@ export default class LeftPaneContainer extends FlexContainer<Component> {
|
||||
if (visible) {
|
||||
this.triggerEvent("focusTree", {});
|
||||
} else {
|
||||
this.triggerEvent("focusOnDetail", { ntxId: appContext.tabManager.getActiveContext()?.ntxId });
|
||||
const ntxId = appContext.tabManager.getActiveContext()?.ntxId;
|
||||
const noteContainer = document.querySelector(`.note-split[data-ntx-id="${ntxId}"]`);
|
||||
if (!noteContainer?.contains(document.activeElement)) {
|
||||
this.triggerEvent("focusOnDetail", { ntxId });
|
||||
}
|
||||
}
|
||||
|
||||
options.save("leftPaneVisible", this.currentLeftPaneVisible.toString());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user