don't try to activate the pane being currently removed

This commit is contained in:
zadam
2021-10-13 23:27:58 +02:00
parent f505f9d65a
commit 53875d26bc
2 changed files with 10 additions and 4 deletions

View File

@@ -13,6 +13,12 @@ export default class ClosePaneButton extends ButtonWidget {
this.icon("bx-x")
.title("Close this pane")
.titlePlacement("bottom")
.onClick(widget => widget.triggerCommand("closeThisNoteSplit", { ntxId: widget.getNtxId() }));
.onClick((widget, e) => {
// to avoid split pane container detecting click within the pane which would try to activate this
// pane (which is being removed)
e.stopPropagation();
widget.triggerCommand("closeThisNoteSplit", { ntxId: widget.getNtxId() });
});
}
}