Commit c645d680 authored by Jacob Rockowitz's avatar Jacob Rockowitz
Browse files

Issue #3041100 by C.E.A: Add search capability to the "buttons" and "image...

Issue #3041100 by C.E.A: Add search capability to the "buttons" and "image select" elements. Fix keyboard navigation.
parent 210ee1db
Loading
Loading
Loading
Loading
+12 −2
Changes for modules/webform_image_select/js/webform_image_select.element.js: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -94,12 +94,22 @@
            }
            else if (event.which === 37 || event.which === 38) {
              // Left or Up.
              $(this).parent().prev().find('.thumbnail').focus();
              var $prev = $(this).parent();
              do {
                $prev = $prev.prev();
              }
              while ($prev.length && $prev.is(':hidden'));
              $prev.find('.thumbnail').focus();
              event.preventDefault();
            }
            else if (event.which === 39 || event.which === 40) {
              // Right or Down.
              $(this).parent().next().find('.thumbnail').focus();
              var $next = $(this).parent();
              do {
                $next = $next.next();
              }
              while ($next.length && $next.is(':hidden'));
              $next.find('.thumbnail').focus();
              event.preventDefault();
            }
          })