Don't match text inputs with a trailing '-selectized' in their id, fixes #2396 (#2418)

* Don't match text inputs with a trailing '-selectized' in their id, fixes #2396

* update news

* parentheses
This commit is contained in:
Carson Sievert
2019-05-14 16:26:32 -05:00
committed by Winston Chang
parent 64b3095f2c
commit 4eaa9c7ea9
2 changed files with 9 additions and 1 deletions

View File

@@ -1,7 +1,12 @@
var textInputBinding = new InputBinding();
$.extend(textInputBinding, {
find: function(scope) {
return $(scope).find('input[type="text"], input[type="search"], input[type="url"], input[type="email"]');
var $inputs = $(scope).find('input[type="text"], input[type="search"], input[type="url"], input[type="email"]');
// selectize.js 0.12.4 inserts a hidden text input with an
// id that ends in '-selectized'. The .not() selector below
// is to prevent textInputBinding from accidentally picking up
// this hidden element as a shiny input (#2396)
return $inputs.not('input[type="text"][id$="-selectized"]');
},
getId: function(el) {
return InputBinding.prototype.getId.call(this, el) || el.name;