reported by wadmiraal:
Even if there's only one suggestion, you still have to use the "down" arrow to "select" it (even though, visually, it is selected). Just hitting enter will only reload the current page. This is a bit strange and not very intuitive. Either the default selected element is active, and hitting enter take's you there OR there's no item selected by default and you must always use the "down" arrow to select one.

Comments

maartenverbaarschot’s picture

michaelmol’s picture

Status: Fixed » Closed (fixed)
aschiwi’s picture

So this is fixed only when there is just one result? From Facebooks search box I am so used to hitting enter resulting in going to the first result (which is highlighted so logically should jump to that item upon hitting enter). I pulled the latest changes from 7.x-1.x. Testing it with only one suggestion is pretty hard, no matter what I type there are always more than one suggestions :)

maartenverbaarschot’s picture

It works with any amount of results.

michaelmol’s picture

@aschiwi in my case when I type "Perf" I'll get 1 result. (will return "Performance" - "admin/config/development/performance" as result)

BarisW’s picture

Works like a charm, thanks!

michaelmol’s picture

Status: Closed (fixed) » Fixed
aschiwi’s picture

I still had the same problem after pulling the code again and deleting the cache, uninstalling and reinstalling the module. Since I was testing it inside a distribution we built I made a fresh install of the distribution and it behaves differently but a little annoying. After typing a few letters the focus goes away from the box (can't keep typing without clicking in the box again) and from the result list I get not the first but last result highlighted. Just wanna report this here, don't have time left right now to test in a vanilla Drupal site.

michaelmol’s picture

Status: Fixed » Postponed (maintainer needs more info)

I have tested Coffee in a couple of different comibations of installs, os and browsers. I can not reproduce the behavior you lined out.
Can you give me some more details about the used combination of os and browser?

aschiwi’s picture

I'm on Mac OS X 10.6.8 and Firefox 9.01. I also tried it in another installation and since that had the same behavior, installed a brand new Drupal, standard profile, with only Coffee installed and it was the same thing. It does work in Safari and Chrome as I just noticed.

I made a short video screencast of the behavior that shows that I only reach the page by clicking, hitting Enter does not work and sometimes the cursor moves out of the input box which results in me not being able to type until I click back in the box. You can view the video at http://screencast.com/t/aeVOQekV

michaelmol’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active

Thanks aschiwi for your screencast in the same setup i experience the same problems.
The first highlighted item doesn't respond on the enter key, but it does when you press key down and key up then it works. The lost focus from the input box seems to be caused by the mouse pointer, what is actually a bug.

maartenverbaarschot can you look at this issue?

When you press enter (and not used the keydown/keyup) it will cause a error in coffee.js:43
event.srcElement is undefined

maartenverbaarschot’s picture

I fixed the js error http://drupalcode.org/sandbox/michaelmol/1356930.git/commit/6563b0b

The lost focus while typing is caused by the mouse pointer; Firefox seems to force a hover event even though the mouse isn't actually moving at that moment. At line 53 in coffee.js the focus is moved along with the hover to prevent multiple highlighted results.

I've commented it out temporarily, so at least it won't screw with the search field focus for now. http://drupalcode.org/sandbox/michaelmol/1356930.git/commit/24c2198

We'll need to find a better solution for it though. It doesn't really make sense with 2 highlighted results just because the mouse pointer is accidentally placed somewhere on a result while typing.

aschiwi’s picture

Now it works for me too, thanks!

michaelmol’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.