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

Method autoFocus

src/material/sidenav/drawer.ts:265–279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

263 */
264 @Input()
265 get autoFocus(): AutoFocusTarget | string | boolean {
266 const value = this._autoFocus;
267
268 // Note that usually we don't allow autoFocus to be set to `first-tabbable` in `side` mode,
269 // because we don't know how the sidenav is being used, but in some cases it still makes
270 // sense to do it. The consumer can explicitly set `autoFocus`.
271 if (value == null) {
272 if (this.mode === 'side') {
273 return 'dialog';
274 } else {
275 return 'first-tabbable';
276 }
277 }
278 return value;
279 }
280 set autoFocus(value: AutoFocusTarget | string | BooleanInput) {
281 if (value === 'true' || value === 'false' || value == null) {
282 value = coerceBooleanProperty(value);

Callers

nothing calls this directly

Calls 1

coerceBooleanPropertyFunction · 0.90

Tested by

no test coverage detected