Option not clickable with mouse click after focus on select

Posted by Manna on Stack Overflow See other posts from Stack Overflow or by Manna
Published on 2014-05-31T09:22:36Z Indexed on 2014/05/31 9:24 UTC
Read the original article Hit count: 236

I have configured a keyboard navigation for customized selects.

Here the codepen to see in action : http://codepen.io/Mannaio/pen/ebyBi?editors=001

You can use the arrows up and down inside the selects and click the option with enter or tab button.

I have a problem now and these are the steps reproduce the error

1) Do Focus on Input Name 2) Press Tab 3) If you hover and then do click with the mouse in any of the select options, they can not be selected with the mouse click

This is the only error, it works perfectly if you move the arrows up and down and then you press the enter o tab, i want to to be able to select the option also with the mouse click after i do the focus with the tab button in the customized select

Technically the problem is that the hover with the keyboards up and down is different when i hover with the mouse in the select-options.

Line 185

function setSelected(menuitem) {
  $("ul.select-options.active li").removeClass("itemhover");
  $("ul.select-options.active li").eq(menuitem).addClass("itemhover");
};

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery