fix for contained

pull/1460/head
Cory LaViska 2023-07-18 12:39:44 -04:00
rodzic 201ff4efc5
commit 956271880d
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -151,7 +151,12 @@ export default class SlDrawer extends ShoelaceElement {
}
private handleDocumentKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape' && this.modal.isActive() && this.open && !this.contained) {
// Contained drawers aren't modal and don't response to the escape key
if (!this.contained) {
return;
}
if (event.key === 'Escape' && this.modal.isActive() && this.open) {
event.stopImmediatePropagation();
this.requestClose('keyboard');
}