Skip to content

Commit 2372112

Browse files
committed
fix(material/select): added ecs click handling in host keydown
The esc button was processed only in the overlay, which led to the container not closing in sidenav. Fixes #30507
1 parent d6fd276 commit 2372112

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/material/select/select.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,10 @@ export class MatSelect
10331033
hasDeselectedOptions ? option.select() : option.deselect();
10341034
}
10351035
});
1036+
} else if (event.keyCode === ESCAPE && !hasModifierKey(event)) {
1037+
event.stopPropagation();
1038+
event.preventDefault();
1039+
this.close();
10361040
} else {
10371041
const previouslyFocusedIndex = manager.activeItemIndex;
10381042

0 commit comments

Comments
 (0)