FIX: prevent event bubbling when closing modals with escape key (#22928)
This change prevents event bubbling for the Escape key on all modals. Currently when we close the modal using the Escape key, all other event listeners attached will also be triggered (such as closing the chat drawer if it's open).
This commit is contained in:
parent
5ae0220638
commit
906bfdebea
|
@ -86,6 +86,7 @@ export default class DModal extends Component {
|
|||
}
|
||||
|
||||
if (event.key === "Escape" && this.dismissable) {
|
||||
event.stopPropagation();
|
||||
this.args.closeModal({ initiatedBy: CLOSE_INITIATED_BY_ESC });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue