Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression in repeated appendTab()s when navbarMenu() is present #3518

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inst/www/shared/shiny.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions inst/www/shared/shiny.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/www/shared/shiny.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inst/www/shared/shiny.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions srcts/src/shiny/shinyapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,8 @@ class ShinyApp {
// loop through all existing tabs, find the one with highest id
// (since this is based on a numeric counter), and increment

$tabset.find("a[data-toggle='tab']").each(function () {
const $tab = $(this);
$tabset.find("> li").each(function () {
const $tab = $(this).find("> a[data-toggle='tab']");
Comment on lines +1115 to +1116
Copy link
Collaborator Author

@cpsievert cpsievert Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reverts the logic back to the way it was in the 1.6.0 release (

shiny/srcjs/shinyapp.js

Lines 876 to 885 in b57cb6c

$tabset.find("> li").each(function() {
var $tab = $(this).find("> a[data-toggle='tab']");
if ($tab.length > 0) {
// remove leading url if it exists. (copy of bootstrap url stripper)
var href = $tab.attr("href").replace(/.*(?=#[^\s]+$)/, '');
// remove tab id to get the index
var index = href.replace("#tab-" + tabsetId + "-", "");
existingTabIds.push(Number(index));
}
});
)

I originally changed this logic because, for a short period, we were working around a BS4 regression that dropped support for dropdown items wrapped in <li>. That regression has since been fixed and is now included with bs_theme(version = 4), so this change in logic is no longer needed


if ($tab.length > 0) {
// remove leading url if it exists. (copy of bootstrap url stripper)
Expand Down