Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Mario-Eis opened this issue Jun 20, 2017 · 1 comment · Fixed by #5255
Closed

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

Mario-Eis opened this issue Jun 20, 2017 · 1 comment · Fixed by #5255
Assignees
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@Mario-Eis
Copy link

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.

@crisbeto crisbeto self-assigned this Jun 20, 2017
@crisbeto crisbeto added has pr P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Jun 20, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 20, 2017
Exposes the `focus` method from `md-select` for consistency with `md-input-container`.

Fixes angular#5251.
jelbourn pushed a commit that referenced this issue Jun 23, 2017
Exposes the `focus` method from `md-select` for consistency with `md-input-container`.

Fixes #5251.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants