ember-widgets icon indicating copy to clipboard operation
ember-widgets copied to clipboard

SelectComponent query text behavior

Open uwo opened this issue 10 years ago • 4 comments

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 ...

uwo avatar Aug 13 '14 21:08 uwo

These both sound like good changes to me! Do you agree @bigsley?

azirbel avatar Aug 18 '14 19:08 azirbel

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

bigsley avatar Aug 18 '14 20:08 bigsley

A PR sounds great. Thanks for offering!

azirbel avatar Aug 18 '14 20:08 azirbel

https://github.com/Addepar/ember-widgets/pull/140

igillis avatar Nov 14 '14 21:11 igillis