MCPcopy Index your code
hub / github.com/angular/components / autoFocus

Method autoFocus

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

coerceBooleanPropertyFunction · 0.90

Tested by

no test coverage detected