Skip to content

Commit 5e238fd

Browse files
committed
Force close all drawers correctly
Fixes #6030
1 parent 4d3213f commit 5e238fd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

panel/src/panel/drawer.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,18 @@ export default (panel) => {
3737
return;
3838
}
3939

40-
// Force close all drawers
41-
if (id === true) {
42-
this.history.clear();
43-
}
44-
4540
// Compare the drawer id to avoid closing
4641
// the wrong drawer. This is particularly useful
4742
// in nested drawers.
48-
if (id !== undefined && id !== this.id) {
43+
if (id !== undefined && id !== true && id !== this.id) {
4944
return;
5045
}
5146

52-
this.history.removeLast();
47+
if (id === true) {
48+
this.history.clear();
49+
} else {
50+
this.history.removeLast();
51+
}
5352

5453
// no more items in the history
5554
if (this.history.isEmpty() === true) {

0 commit comments

Comments
 (0)