ember-widgets
ember-widgets copied to clipboard
SelectComponent query text behavior
I added a couple small changes to behavior for use in my project. Is there any interest in merging them? I'm happy to make a pull request.
Clear search text on selection:
Ember.Widgets.SelectComponent =
... snip ...
userDidSelect: (selection) ->
@set 'query', ''
@sendAction 'userSelected', selection
... snip ...
Select existing search text when input is focused, e.g. after pressing escape or clicking the body:
Ember.Widgets.SelectComponent =
... snip ...
searchView: Ember.TextField.extend
focusIn: (event) ->
Ember.run.next ->
Ember.$(event.target).select()
... snip ...
These both sound like good changes to me! Do you agree @bigsley?
W/r/t the second bit of code, would that make it so that if you click the select after focusing out then your cursor is in the search box? If so, both these changes LGTM
A PR sounds great. Thanks for offering!
https://github.com/Addepar/ember-widgets/pull/140