Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/material/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ export class MatSelect
if (isArrowKey && event.altKey) {
// Close the select on ALT + arrow key to match the native <select>
event.preventDefault();
// Stop propagation so the event doesn't bubble to the host element and trigger
// _handleClosedKeydown, which would re-open the panel immediately.
event.stopPropagation();
// Restore focus to the trigger before closing so focus isn't lost when the overlay detaches.
this.focus();
this.close();
// Don't do anything in this case if the user is typing,
// because the typing sequence can include the space key.
Expand All @@ -952,6 +957,9 @@ export class MatSelect
!hasModifierKey(event)
) {
event.preventDefault();
// Stop propagation so the event doesn't bubble to the host element and trigger
// _handleClosedKeydown, which would re-open the panel immediately.
event.stopPropagation();
manager.activeItem._selectViaInteraction();
} else if (!isTyping && this._multiple && keyCode === A && event.ctrlKey) {
event.preventDefault();
Expand Down
Loading