poteto / ember-hypersearch

Hyperspeed real-time search with caching
MIT License
55 stars 24 forks source link

Allow arrow key to highlight results #16

Closed keithbro closed 7 years ago

keithbro commented 8 years ago

Hi Lauren

Firstly, thanks for this addon - it's great!

I'd like to add some functionality to be able to navigate through the results with the arrow keys. I've got the functionality pretty much working, but I'm having some trouble writing a suitable test.

The problem is Pretender is returning a JavaScript array, but in my new code I want to use .any and .objectAt which are Ember Array methods. I can see you've partially solved the issue in dummy/app/routes/application.js where the results are wrapped in emberArray. However, the hyper-search component itself also makes a request (using the ajax method). This data is a plain JS array in tests, which is awkward.

Do you have any thoughts for a good solution to this?

Artistan commented 8 years ago

implemented in fork/rename to hypersearcher... https://www.npmjs.com/package/ember-hypersearcher