Skip to content

MdButton: 'focus()' API method doesn't focus the button #7510

@denver-HJS

Description

@denver-HJS

Bug, feature request, or proposal:

Bug(?)

What is the expected behavior?

The button should become focused after calling the API method, so that the user visually sees it's been focused and they can hit the enter key to activate the button, etc.

What is the current behavior?

Nothing happens visually, and there are no console errors output.

What are the steps to reproduce?

StackBlitz using latest npm: https://stackblitz.com/edit/angular-material2-issue-wckfr5

What is the use-case or motivation for changing an existing behavior?

When the user makes a form control selection I would like to focus the submit button for improved UX flow.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

C:\src\git\myProject>ng version
@angular/cli: 1.4.3
node: 7.2.1
os: win32 x64
@angular/animations: 4.4.3
@angular/cdk: 2.0.0-beta.11
@angular/common: 4.4.3
@angular/compiler: 4.4.3
@angular/core: 4.4.3
@angular/flex-layout: 2.0.0-beta.9-0da1f88
@angular/forms: 4.4.3
@angular/http: 4.4.3
@angular/material: 2.0.0-beta.11
@angular/platform-browser: 4.4.3
@angular/platform-browser-dynamic: 4.4.3
@angular/router: 4.4.3
@angular/cli: 1.4.3
@angular/compiler-cli: 4.4.3
@angular/language-service: 4.4.3
typescript: 2.5.3

Am I misunderstanding what the focus API method is meant to do?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions