Skip to content

Commit 2241c43

Browse files
committed
Fix typo and add comment
1 parent 31bfaba commit 2241c43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cdk/overlay/keyboard/overlay-keyboard-dispatcher.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class OverlayKeyboardDispatcher implements OnDestroy {
5151
}
5252

5353
/**
54-
* Subscribe to all key events that land on the body and dipatch those
54+
* Subscribe to all key events that land on the body and dispatch those
5555
* events to the appropriate overlay.
5656
*/
5757
private _dispatchKeyboardEvents(): void {
@@ -76,6 +76,7 @@ export class OverlayKeyboardDispatcher implements OnDestroy {
7676
const targetedOverlay = this._attachedOverlays.find(overlay =>
7777
overlay.overlayElement.contains(event.target as HTMLElement));
7878

79+
// Use that overlay if it exists, otherwise choose the most recently attached one
7980
return targetedOverlay ? targetedOverlay : overlays[overlays.length - 1];
8081
}
8182

0 commit comments

Comments
 (0)