Skip to content

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

Merged
cpsievert merged 1 commit intomasterfrom
append-tab-patch
Sep 30, 2021
Merged

Fix regression in repeated appendTab()s when navbarMenu() is present#3518
cpsievert merged 1 commit intomasterfrom
append-tab-patch

Conversation

@cpsievert
Copy link
Copy Markdown
Collaborator

Closes #3516

Comment on lines +1115 to +1116
$tabset.find("> li").each(function () {
const $tab = $(this).find("> a[data-toggle='tab']");
Copy link
Copy Markdown
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

@cpsievert cpsievert merged commit e6d94f6 into master Sep 30, 2021
@cpsievert cpsievert deleted the append-tab-patch branch September 30, 2021 19:43
schloerke added a commit that referenced this pull request Oct 1, 2021
* master:
  Update NEWS
  Use esbuild option preserveSymlinks
  Fix regression in repeated appendTab()s when navbarMenu() is present (#3518)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamically inserted tabs fail to render when navbarMenu() is present

2 participants