First time here? Check out the FAQ!

Revision history  [back]

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?

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/). search.

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?