-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix selectize event namespacing issues (#3919)
Co-authored-by: cpsievert <[email protected]>
- Loading branch information
Showing
4 changed files
with
39 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tools/selectize-patches/007-selectize-event-namespace-bugfix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/inst/www/shared/selectize/js/selectize.js b/inst/www/shared/selectize/js/selectize.js | ||
index 0b447a7b3..cbfe9178e 100644 | ||
--- a/inst/www/shared/selectize/js/selectize.js | ||
+++ b/inst/www/shared/selectize/js/selectize.js | ||
@@ -834,6 +834,9 @@ var Selectize = function($input, settings) { | ||
|
||
self.settings = {}; | ||
|
||
+ // increase the count of 'active' (i.e., non-destroyed) selectize instances | ||
+ ++Selectize.count; | ||
+ | ||
$.extend(self, { | ||
order : 0, | ||
settings : settings, | ||
@@ -841,8 +844,8 @@ var Selectize = function($input, settings) { | ||
tabIndex : $input.attr('tabindex') || '', | ||
tagType : input.tagName.toLowerCase() === 'select' ? TAG_SELECT : TAG_INPUT, | ||
rtl : /rtl/i.test(dir), | ||
- | ||
- eventNS : '.selectize' + (++Selectize.count), | ||
+ // generate a unique ID for the event namespace | ||
+ eventNS : '.selectize-' + (new Date().getTime()) + '-' + (Math.random().toString(36).substr(2, 5)), | ||
highlightedValue : null, | ||
isBlurring : false, | ||
isOpen : false, |