Skip to content

Instantly share code, notes, and snippets.

@olimortimer
Created October 1, 2013 08:56
Show Gist options
  • Save olimortimer/6775681 to your computer and use it in GitHub Desktop.
Save olimortimer/6775681 to your computer and use it in GitHub Desktop.
JS: Select2 FastClick Fix
$('#select2').select2({
data: data,
// Add our 'needsclick' to each item, so FastClick doesn't get applied
formatResult: function(result, container, query, escapeMarkup) {
container.addClass('needsclick');
return result.text;
}
});
@superKalo
Copy link

If you are looking for a solution for the combination between Select2 4.0.1 and FastClick 1.0.6 (both latest by the time I am writing this), see my fix here: select2/select2#3222 (comment)

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