Skip to content

Instantly share code, notes, and snippets.

@biesbjerg
Last active April 22, 2016 16:09
Show Gist options
  • Save biesbjerg/bb28ba80862d57306a0e to your computer and use it in GitHub Desktop.
Save biesbjerg/bb28ba80862d57306a0e to your computer and use it in GitHub Desktop.
Fix for Selectize and FastClick
PLUGIN (save as selectize-fast-click.js and load after selectize.js):
------------------------------------------------------
Selectize.define('fast_click', function(options) {
var self = this;
this.render = (function() {
var original = self.render;
return function(templateName, data) {
var html = original.apply(this, arguments);
var $output = $(html).addClass('needsclick');
return $output.get(0).outerHTML;
};
})();
});
USAGE:
------------------------------------------------------
$('select').selectize({
plugins: ['fast_click']
});
@dangzo
Copy link

dangzo commented Apr 22, 2016

Perfectly working, thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment