This commit is contained in:
Cory LaViska
2022-11-23 10:38:04 -05:00
parent 6579a95999
commit 7f9b0bd5a2
2 changed files with 3 additions and 1 deletions

View File

@@ -214,7 +214,8 @@ export default class SlDropdown extends ShoelaceElement {
handleTriggerKeyDown(event: KeyboardEvent) {
// Close when escape or tab is pressed
if (event.key === 'Escape') {
if (event.key === 'Escape' && this.open) {
event.stopPropagation();
this.focusOnTrigger();
this.hide();
return;