First time here? Check out the FAQ!
0

live search issue with enter key on sandbox

with latest code 0.7.48

On askbot.org if I do live search (e.g. migration) and then use up and down arrow keys to select a question on the drop menu and then press enter key when I find the one I want to see, everything works fine.

In my sandbox on the other hand, (python setup.py develop; python manage.py runserver '127.0.0.1:8000') then the enter key does not take me to the question. Instead I am taken to some other search (http://localhost:8000/questions/scope:all/sort:activity-desc/query:abacus/page:1/).

I have narrowed down the problem to two "keydown" handlers getting installed.

in live_search.js, FullTextSearch sets the keydown hander

// enable query box
var main_page_eval_handle;
//this._query.keydown(this.makeKeyDownHandler());
this._query.keyup(function(e){

and SearchDropMenu installs another keydown handler in createDom

$(document).keydown(this.makeKeyHandler());

It seems to me that the handler in SearchDropMenu performs the correct action - navigating to the url of the item. I commented out the keydown for FullTextSearch and it works as expected.

The mysterious part for me is that I used Chrome to test this my sandbox and askbot.org/en/questions side by side. Using the debugger, I could see that the askbot.org executed the proper keydown handler every time and on my sandbox it executed the other keydown handler every time.

Should there be only one key event handler? Is there something different about production and sandbox that would make one execute instead of another?

jeffmad's avatar
33
jeffmad
asked 2013-02-27 16:03:55 -0600, updated 2013-02-27 16:15:42 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Jeff, please try the latest code from the repository. I have made some changes to the search, and hopefully this issue resolves. Sorry, I cannot look into this unless the issue is still present in the repository.

Evgeny's avatar
13.2k
Evgeny
answered 2013-02-27 16:13:49 -0600
edit flag offensive 0 remove flag delete link

Comments

I am using latest code: $ git log -2 commit cec681f1b4551e3d8588cf2d22e4eae3a8c08b66 Author: Evxxxx Fxxxxx <xxxx> Date: Tue Feb 26 19:38:21 2013 -0300

allowed search by email address in the user search bar
jeffmad's avatar jeffmad (2013-02-27 16:25:54 -0600) edit

And you still have this issue?

Evgeny's avatar Evgeny (2013-02-27 16:28:42 -0600) edit

Allright, thanks I can reproduce this, will get it fixed soon. The enter key in the search bar must initiate the full text search, while enter key on the dropdown when the selection is made - should take you to the corresponding question.

Evgeny's avatar Evgeny (2013-02-27 16:31:10 -0600) edit
add a comment see more comments