MCPcopy Create free account
hub / github.com/angular/components / _recaptureFocus

Method _recaptureFocus

src/cdk/dialog/dialog-container.ts:208–212  ·  view source on GitHub ↗

Captures focus if it isn't already inside the dialog.

()

Source from the content-addressed store, hash-verified

206 // TODO(crisbeto): this shouldn't be exposed, but there are internal references to it.
207 /** Captures focus if it isn't already inside the dialog. */
208 _recaptureFocus() {
209 if (!this._containsFocus()) {
210 this._trapFocus();
211 }
212 }
213
214 /**
215 * Focuses the provided element. If the element is not focusable, it will add a tabIndex

Callers 1

constructorMethod · 0.80

Calls 2

_containsFocusMethod · 0.95
_trapFocusMethod · 0.95

Tested by

no test coverage detected