-
Notifications
You must be signed in to change notification settings - Fork 81
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
Content not updated if collapsed = TRUE in Box #19
Comments
This is what I get from the shiny trace:
As you can see, the distPlot is hidden even when the collapse button is clicked. This mean that I need to create a jQuery event that will make the card content show when collapse is pressed, and inversely. This is what happens between tabs in the sidebar and in the body: without jQuery nothing is displayed. See below (in shinydashboard.js): // When document is ready, if there is a sidebar menu with no activated tabs,
// activate the one specified by `data-start-selected`, or if that's not
// present, the first one.
var ensureActivatedTab = function() {
var $tablinks = $(".sidebar-menu a[data-toggle='tab']");
// If there's a `data-start-selected` attribute and we can find a tab with
// that name, activate it.
var $startTab = $tablinks.filter("[data-start-selected='1']");
if ($startTab.length === 0) {
// If no tab starts selected, use the first one, if present
$startTab = $tablinks.first();
}
// If there are no tabs, $startTab.length will be 0.
if ($startTab.length !== 0) {
$startTab.tab("show");
// This is indirectly setting the value of the Shiny input by setting
// an attribute on the html element it is bound to. We cannot use the
// inputBinding's setValue() method here because this is called too
// early (before Shiny has fully initialized)
$(".sidebarMenuSelectedTabItem").attr("data-value",
$startTab.attr("data-value"));
}
}; If no tab is selected by the user, the first one is selected. They also add the "show" even to the related tab so that the content is displayed. By the way, I need to see in the bootstrap 4 documentation what is available for card since it is different from a tab. |
I also fixed the icon: + then the card is collapsed and - when it is uncollapsed |
Hi,
Thanks for putting bootstrap 4 available for Shiny applications.
I am running the github version. I face a problem with collapsed box.
When I uncollapse the box, the content does not appear. I will try to explore this but if you have an idea and/or a fix, that would be nice.
Below is a reproducible example:
The text was updated successfully, but these errors were encountered: