Skip to content

Commit 2c077b9

Browse files
committed
Use native classList API instead of jQuery for class toggling
1 parent 22e0a0b commit 2c077b9

5 files changed

Lines changed: 23 additions & 21 deletions

File tree

inst/www/shared/shiny.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

srcts/src/shiny/shinyapp.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,17 @@ class ShinyApp {
616616
const nsPrefix = el.attr("data-ns-prefix") as string;
617617
const nsScope = this._narrowScope(scope, nsPrefix);
618618
const show = Boolean(condFunc(nsScope));
619-
const showing = el.hasClass(conditionalShownClass);
619+
const rawEl = conditionals[i];
620+
const showing = rawEl.classList.contains(conditionalShownClass);
620621

621622
if (show !== showing) {
622623
if (show) {
623624
el.trigger("show");
624-
el.addClass(conditionalShownClass);
625+
rawEl.classList.add(conditionalShownClass);
625626
el.trigger("shown");
626627
} else {
627628
el.trigger("hide");
628-
el.removeClass(conditionalShownClass);
629+
rawEl.classList.remove(conditionalShownClass);
629630
el.trigger("hidden");
630631
}
631632
}

0 commit comments

Comments
 (0)