Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions jquery.selectBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@
// left
event.preventDefault();
if (control.hasClass('selectBox-menuShowing')) {
var prev = options.find('.selectBox-hover').prev('LI');
var currentHover = options.find('.selectBox-hover'),
prev = currentHover.length === 0 ? options.find("LI:first") : currentHover.prev('LI');
totalOptions = options.find('LI:not(.selectBox-optgroup)').length;
i = 0;
while (prev.length === 0 || prev.hasClass('selectBox-disabled') ||
Expand Down Expand Up @@ -827,7 +828,8 @@
// right
event.preventDefault();
if (control.hasClass('selectBox-menuShowing')) {
var next = options.find('.selectBox-hover').next('LI');
var currentHover = options.find('.selectBox-hover'),
next = currentHover.length === 0 ? options.find("LI:first") : currentHover.next('LI');
totalOptions = options.find('LI:not(.selectBox-optgroup)').length;
i = 0;
while (0 === next.length || next.hasClass('selectBox-disabled') ||
Expand Down