Closed (fixed)
Project:
Coffee
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
11 Jan 2012 at 09:24 UTC
Updated:
28 Mar 2014 at 12:47 UTC
Jump to comment: Most recent
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
Comment #1
maartenverbaarschot commentedhttp://drupalcode.org/sandbox/michaelmol/1356930.git/commit/dc1598e
Comment #2
michaelmol commentedComment #3
aschiwi commentedSo 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 :)
Comment #4
maartenverbaarschot commentedIt works with any amount of results.
Comment #5
michaelmol commented@aschiwi in my case when I type "Perf" I'll get 1 result. (will return "Performance" - "admin/config/development/performance" as result)
Comment #6
BarisW commentedWorks like a charm, thanks!
Comment #7
michaelmol commentedComment #8
aschiwi commentedI 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.
Comment #9
michaelmol commentedI 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?
Comment #10
aschiwi commentedI'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
Comment #11
michaelmol commentedThanks 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:43event.srcElement is undefinedComment #12
maartenverbaarschot commentedI 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.
Comment #13
aschiwi commentedNow it works for me too, thanks!
Comment #14
michaelmol commented