Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

pre-select text in input on md-autofocus? #6679

Closed
adrianandreias opened this issue Jan 14, 2016 · 4 comments
Closed

pre-select text in input on md-autofocus? #6679

adrianandreias opened this issue Jan 14, 2016 · 4 comments

Comments

@adrianandreias
Copy link

Shouldn't the text in an input box be selected when using md-autofocus on an input box?

<md-input-container>
  <label>Name</label>
  <input name="name" type="text" value="abc" md-autofocus>
</md-input-container>

Currently the focus is set on the input box, but the cursor is placed at the end of text.

I'd prefer to have the text pre-selected, that's what happens when you use TAB key to move to another input box.

If you still think this behavior is fine what do you recommend to use in order to have the text pre-selected?

@ThomasBurleson
Copy link
Contributor

IMO, this would be an enhancement with something like a selectOnFocus directive.

A PR is encouraged.

@bluebirdtech
Copy link

Really helpful, thank you. I can now delete some custom code!

How about the same attribute for md-autocomplete?

ErinCoughlan pushed a commit to ErinCoughlan/material that referenced this issue Feb 9, 2016
@devversion
Copy link
Member

@bluebirdtech You can create another issue for the autocomplete 👍

@bluebirdtech
Copy link

Done, thanks! #7125

@Splaktar Splaktar removed this from the - Backlog milestone Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants