From 4eaa9c7ea9798b9cbe034aeb34121edb6cf1c16e Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 14 May 2019 16:26:32 -0500 Subject: [PATCH] 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 --- NEWS.md | 3 +++ srcjs/input_binding_text.js | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 7f818eba7..8d30031c1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,7 +13,10 @@ shiny 1.3.2.9000 * Fixed [#2250](https://github.com/rstudio/shiny/issues/2250): `updateSliderInput()` now works with un-specified (or zero-length) `min`, `max`, and `value`. ([#2416](https://github.com/rstudio/shiny/pull/2416)) +* Fixed [#2396](https://github.com/rstudio/shiny/issues/2396): `selectInput("myID", ...)` resulting in an extra `myID-selectized` input (introduced in v1.2.0). ([#2418](https://github.com/rstudio/shiny/pull/2418)) + * Fixed [#2233](https://github.com/rstudio/shiny/issues/2233): `verbatimTextOutput()` produced wrapped text on Safari, but the text should not be wrapped. ([#2353](https://github.com/rstudio/shiny/pull/2353)) + * Fixed [rstudio/reactlog#36](https://github.com/rstudio/reactlog/issues/36): Changes to reactive values not displaying accurately in reactlog. ([#2424](https://github.com/rstudio/shiny/pull/2424)) * Fixed [#2329](https://github.com/rstudio/shiny/issues/2329), [#1817](https://github.com/rstudio/shiny/issues/1817): These bugs were reported as fixed in Shiny 1.3.0 but were not actually fixed because some JavaScript changes were accidentally not included in the release. The fix resolves issues that occur when `withProgressBar()` or bookmarking are combined with the [networkD3](https://christophergandrud.github.io/networkD3/) package's Sankey plot. diff --git a/srcjs/input_binding_text.js b/srcjs/input_binding_text.js index 3c3031141..84dbe8657 100644 --- a/srcjs/input_binding_text.js +++ b/srcjs/input_binding_text.js @@ -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;