()
| 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); |
nothing calls this directly
no test coverage detected