simplesmiler / vue-focus

A reusable focus directive for reusable Vue.js components
MIT License
406 stars 40 forks source link

Event modifier which enables text selection on focus #11

Open jessegavin opened 7 years ago

jessegavin commented 7 years ago

I am building a UI for an app where users will want to quickly change number values in a table (like a spreadsheet). It would be much better in this case to have the entire contents of the input selected on focus.

This pull request adds an event modifier v-focus.select='expression' which does just that.

feload commented 7 years ago

Yes, yes, yes!! Please accept this pull request :)

jessegavin commented 6 years ago

@simplesmiler any thoughts on this PR?

DaveSweeton commented 6 years ago

@simplesmiler I'd also like this feature!

shepelevstas commented 6 years ago

Does it allow to use it like this: v-focus.lazy.select="true"?

jessegavin commented 6 years ago

@shepelevstas yes, that's how I have been using it.