diff --git a/panel/src/panel/drawer.js b/panel/src/panel/drawer.js index a1f8669ceb..ef9ed52d77 100644 --- a/panel/src/panel/drawer.js +++ b/panel/src/panel/drawer.js @@ -37,19 +37,18 @@ export default (panel) => { return; } - // Force close all drawers - if (id === true) { - this.history.clear(); - } - // Compare the drawer id to avoid closing // the wrong drawer. This is particularly useful // in nested drawers. - if (id !== undefined && id !== this.id) { + if (id !== undefined && id !== true && id !== this.id) { return; } - this.history.removeLast(); + if (id === true) { + this.history.clear(); + } else { + this.history.removeLast(); + } // no more items in the history if (this.history.isEmpty() === true) {