Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 861
  • Last Modified:

The hover works but the keyup or keydown skips over li elements, why and how to fix this?

I have a list of li elements that gets loaded from the server. On the first load of the ul li, the can hit the keyup or keydown to scroll up and down the list with no problems.

On second load of the ul li list (around 8 li elements), it skips elements. For elements, it correctly highlight the first element (index 0) but skips to the next (index 1). What I mean by skip is that it correctly highlight the skip element (index 1) but does not stop to at this skipped element and keeps going to element of index 2.

On second load of li
<li>aaaaa</li>  // highlighted and stopped
<li>bbbbb</li> // highlighted but move to li cccccccc
<li>ccccccc</li> // highlight and stopped
<li>ddddd</li> // highlight but move to li, next....

How can I get it to stop skipping? I can all is working when I put alerts...
  • 2
1 Solution
It helps is you post the code you are using so we can help you figure out what's going wrong ...
areyouready344Author Commented:
this event solved the problem, e.stopImmediatePropagation();
areyouready344Author Commented:
I originally had e.stopPropagation(); and changed it to e.stopImmediatePropagation(); and the skipped element no longer gets skipped.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now