Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Complete: Selection after tpying and pressing Enter #80

Open
TomTomRixRix opened this issue Dec 15, 2017 · 14 comments
Open

Auto Complete: Selection after tpying and pressing Enter #80

TomTomRixRix opened this issue Dec 15, 2017 · 14 comments

Comments

@TomTomRixRix
Copy link

In all Auto Complete field, mainly the Studierendes and Ordner fields, it would be nice if one could simply type in an item and select it by pressing Enter in the end. This should obviously only work when the corresponding item exists in the list. Especially when selecting folder this would be really convenient as one would only tpye ''KM1A" + "Enter" and does not need to look at the screen at all and find the right item.

@SinForest
Copy link

Also, like on many other websites, the folder name should be confimable via the , key.

@samuscherer
Copy link
Member

Alternatively, we could use semicolons instead of commas.

@henrixapp
Copy link
Collaborator

Help wanted. Not supported by ember-paper yet. adopted-ember-addons/ember-paper#871

@Sedrunum
Copy link
Contributor

We are waiting for external help.

@xomaczar
Copy link

Using defaultHighlighted with paper-autocomplete, solves this issue. DefaultHighlighted will highlight the first match allowing user to hit ENTER key and select w/o using mouse. We can add an example to dummy app so it’s clear for everyone.

@Sedrunum
Copy link
Contributor

@xomaczar Does this also work if I use the search function to create my options' list for the autocomplete field which queries the remote database for matching keywords?

My approach so far:

save the queried results to a variable (studentoptions) inside the controller
-> add defaultHighlighted=(take 1 studentoptions) to the autocomplete tag

Sadly I haven't observed any difference - the first entry is still not highlighted.

@Sedrunum
Copy link
Contributor

(take 1 studentoptions) is part of the ember-composable-helper package

@Sedrunum
Copy link
Contributor

From my understanding the defaultHighlighted option only highlights the specified entry when the list is initially opened. If I modify the provided options to select from the defaultHighlighted option wont help me focusing/highlighting the first entry since I have already abandoned the initial state.

@xomaczar
Copy link

xomaczar commented Jul 23, 2018

Yeah it should work -defaultHighlighted should be a function that returns an item that you would like to highlight. take helper returns an item instead of a func. So just define a function - you can find out the signature from eps official docs
https://ember-power-select.com/docs/api-reference

@Sedrunum
Copy link
Contributor

If anyone of you had time, could you provide an example to dummy app? At the moment, it doesn't seem as if the function is actually called if I provide defaultHighlighted=(action 'firstFolder). Thanks in advance

@xomaczar
Copy link

What version of ember-paper are you using?

@Sedrunum
Copy link
Contributor

1.0.0-beta.7

@xomaczar
Copy link

Try it on beta.8

@Sedrunum
Copy link
Contributor

tried it, same result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants