Skip to content

Commit

Permalink
Fix for mobile webkit focus bug selectize#48.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreavis committed Jul 5, 2013
1 parent fe2466a commit 976f99a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ Selectize.prototype.setup = function() {
}
});

// necessary for mobile webkit devices (manual focus triggering
// is ignored unless invoked within a click event)
$control.on('click', function(e) {
if (!self.isInputFocused) {
self.focus(true);
}
});

$dropdown.on('mouseenter', '[data-selectable]', function() { return self.onOptionHover.apply(self, arguments); });
$dropdown.on('mousedown', '[data-selectable]', function() { return self.onOptionSelect.apply(self, arguments); });
watchChildEvent($control, 'mousedown', '*:not(input)', function() { return self.onItemSelect.apply(self, arguments); });
Expand Down

0 comments on commit 976f99a

Please sign in to comment.