From 5e238fd6cc745793ee049ae1a2614d1365fb0d22 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 15 Aug 2024 22:52:59 +0200 Subject: [PATCH] Force close all drawers correctly Fixes #6030 --- panel/src/panel/drawer.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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) {