PDA

View Full Version : DropDown: How to react on key down



katharina
29 Oct 2007, 4:36 AM
Hi,

I have to create my own dropdown element without using ext. I have problems in opera and safari with the key down press on a dropdown entry (to navigate to the next one). I am doing it like this: if dropdown was opend, the first entry is focused. I have a keyup listener on each dropdown entry. If user presses the key down key, the entry reacts on this event and the next entry is focused then. This works fine in IE and FF, but not in Opera or Safari. In Opera it seems that you can't call the focus() function for e.g. a <p> tag (no onfocus event will start). This only works with <a> tags. But if I focus a <a> tag and press the key down key, the scrollbar will not react, there will be no scrolling effect.

I know that navigating with key down keys works in Opera and Safari with ext (also with scrollbars). I was trying to go through the code to look how it is done here, but it is too much code and I have no chance to go through each line to find what I'm searching for.

So: Can anyone help me and tell me how ext is doing the navigation inside dropdown with keys / scrollbars? Does ext also work with focus or is there another possibility?

Thanks for helping even if it is not a real ext question.

Katharina

Animal
29 Oct 2007, 10:44 AM
To get widgets working right is quite difficult.

I would strongly recommend using what Ext provides.

Why don't you want to use an Ext.form.ComboBox?