Text box loses focus when DIV is hovered

Posted by Konoplianko on Stack Overflow See other posts from Stack Overflow or by Konoplianko
Published on 2010-04-22T14:13:07Z Indexed on 2010/04/22 17:23 UTC
Read the original article Hit count: 253

Filed under:
|
|

Hello.

I have a problem: When I enter a text into suggestion text box, popup panel appears. But when user places mouse over this popup panel with suggestions - text box loses focus.

What should I do to prevent losing focus ?

Example which have the same behaviour: http://demo.raibledesigns.com/gwt-autocomplete/

Thanks for any help.

Update 1

SuggestionMenu which is being shown is extending MenuBar which sets focus for all menu items.

void itemOver(MenuItem item, boolean focus) {
    if (item == null) {
      // Don't clear selection if the currently selected item's menu is showing.
      if ((selectedItem != null)
          && (shownChildMenu == selectedItem.getSubMenu())) {
        return;
      }
    }

    // Style the item selected when the mouse enters.
    selectItem(item);
    if (focus) {
      focus();
    }

    // If child menus are being shown, or this menu is itself
    // a child menu, automatically show an item's child menu
    // when the mouse enters.
    if (item != null) {
      if ((shownChildMenu != null) || (parentMenu != null) || autoOpen) {
        doItemAction(item, false);
      }
    }
  }

It's clear that i cant fix loosing focus. Now question is - how to make on pressing backspace or any key to focus on edit box?

Thanks in advance

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about gwt