Skip to content

Commit

Permalink
Force close all drawers correctly
Browse files Browse the repository at this point in the history
Fixes #6030
  • Loading branch information
distantnative committed Aug 15, 2024
1 parent 4d3213f commit 5e238fd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions panel/src/panel/drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5e238fd

Please sign in to comment.