Skip to content

Commit

Permalink
Fix scrollbar click issue v2 zurb#832
Browse files Browse the repository at this point in the history
  • Loading branch information
SrPatinhas committed Oct 6, 2023
1 parent 252ec34 commit 4f18b5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TributeEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,14 @@ class TributeEvents {
while (li.nodeName.toLowerCase() !== "li") {
li = li.parentNode;
if (!li || li === tribute.menu) {
throw new Error("cannot find the <li> container for the click");
// When li === tribute.menu, it's either a click on the entire component or on the scrollbar (if visible)
li = undefined;
break;
}
}
if (!li) {
return;
}
tribute.selectItemAtIndex(li.getAttribute("data-index"), event);
tribute.hideMenu();

Expand Down

0 comments on commit 4f18b5e

Please sign in to comment.