Skip to content

Add possibility to set the focus to a md-select #5251

@Mario-Eis

Description

@Mario-Eis

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

A possibility to focus a md-select. like mdSelectViewChild.focus()
Input elements provide that feature by injecting the input element as a ViewChild and set the focus to it's native element. That doesn't seem possible for md-select.

What is the current behavior?

The only possibility I found to set the input focus to a md-select dynamically was
viewChild._element.nativeElement.focus();
That works so far, but seems to be quite a hack ;)

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

In my case I need to focus a md-select dynamically for a better user input flow.

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

4.2.3 / beta.6 / at least Chrome, Opera

Is there anything else we should know?

Maybe a common way to dynamically set an input focus to angular material elements would be a good idea.

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions