Sha256: 417a5f793c48bd0acc2ad158b7df62ca5e6ee30a4272d3938e85d8c2c491270d
Contents?: true
Size: 937 Bytes
Versions: 20
Compression:
Stored size: 937 Bytes
Contents
$.fn.select2.defaults.set('theme', 'bootstrap4') $.fn.select2.defaults.set('allowClear', true) $.fn.select2.defaults.set('placeholder', 'Select...') $.fn.select2.defaults.set('minimumResultsForSearch', 6) $.fn.select2.defaults.set('dropdownParent', $('#modal-root')) # # Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection" # see: https://github.com/select2/select2/issues/5993 # see: https://github.com/jquery/jquery/issues/4382 # # TODO: Recheck with the select2 GH issue and remove once this is fixed on their side # $(document).on 'select2:open', () => document.querySelector('.select2-search__field').focus() initSelect2s = () -> $('select').not('.no-select2').each (k,v) => $(v).select2({ dropdownParent: $(v).parent() }) $(document).ready -> initSelect2s() $(document).on 'show.bs.modal', (e) => $('select').not('.no-select2').each (k,v) => $(v).select2({ dropdownParent: $(v).parent() })
Version data entries
20 entries across 20 versions & 1 rubygems