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

SelectComponent query text behavior #91

Open
uwo opened this issue Aug 13, 2014 · 4 comments
Open

SelectComponent query text behavior #91

uwo opened this issue Aug 13, 2014 · 4 comments

Comments

@uwo
Copy link

uwo commented Aug 13, 2014

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 ...
@azirbel
Copy link
Contributor

azirbel commented Aug 18, 2014

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

@bigsley
Copy link
Contributor

bigsley commented Aug 18, 2014

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

@azirbel
Copy link
Contributor

azirbel commented Aug 18, 2014

A PR sounds great. Thanks for offering!

@igillis
Copy link
Contributor

igillis commented Nov 14, 2014

#140

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants