File tree Expand file tree Collapse file tree 3 files changed +26
-5
lines changed
changelog/entries/unreleased/bug
web-frontend/modules/core Expand file tree Collapse file tree 3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " bug" ,
3+ "message" : " Only close the last opened modal when the esc key is pressed." ,
4+ "domain" : " core" ,
5+ "issue_number" : 3495 ,
6+ "bullet_points" : [],
7+ "created_at" : " 2025-10-14"
8+ }
Original file line number Diff line number Diff line change @@ -158,11 +158,6 @@ export default {
158158 default: false ,
159159 required: false ,
160160 },
161- canClose: {
162- type: Boolean ,
163- default: true ,
164- required: false ,
165- },
166161 collapsibleRightSidebar: {
167162 type: Boolean ,
168163 default: false ,
Original file line number Diff line number Diff line change @@ -9,8 +9,16 @@ export default {
99 // when you release the mouse at different coordinates. Therefore we expect this
1010 // variable to be set on mousedown to be consistent.
1111 downElement : null ,
12+ isModal : true ,
1213 }
1314 } ,
15+ props : {
16+ canClose : {
17+ type : Boolean ,
18+ default : true ,
19+ required : false ,
20+ } ,
21+ } ,
1422 mounted ( ) {
1523 this . $bus . $on ( 'close-modals' , this . hide )
1624 } ,
@@ -68,6 +76,16 @@ export default {
6876 return
6977 }
7078
79+ const hasOpenModalAsChild = this . moveToBody . children . some ( ( child ) => {
80+ return child . isModal === true && child . open === true
81+ } )
82+ // When the `esc` key is pressed and multiple modals are open, then we don't
83+ // want to close them all. Only last opened modal should close. This will make
84+ // sure that if there is an open child modal, it will not hide the parent modal.
85+ if ( hasOpenModalAsChild ) {
86+ return
87+ }
88+
7189 // This is a temporary fix. What happens is the modal is opened by a context menu
7290 // item and the user closes the modal, the element is first deleted and then the
7391 // click outside event of the context is fired. It then checks if the click was
You can’t perform that action at this time.
0 commit comments