Skip to content

Commit

Permalink
hide/show: only bubble up the DOM tree to the nearest input container…
Browse files Browse the repository at this point in the history
… if the current element is an input; fixes #153
  • Loading branch information
daattali committed Feb 10, 2018
1 parent 21dc451 commit 998786a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions inst/srcjs/shinyjs-default-funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ shinyjs = function() {
var _getContainer = function(els) {
return $.map(els, function(el) {
el = $(el);
var inputContainer = el.closest(".shiny-input-container");
if (inputContainer.length > 0) {
el = inputContainer;
if (el.hasClass("shiny-bound-input")) {
var inputContainer = el.closest(".shiny-input-container");
if (inputContainer.length > 0) {
el = inputContainer;
}
}
return el;
});
Expand Down

0 comments on commit 998786a

Please sign in to comment.