RinteRface / shinydashboardPlus

extensions for shinydashboard
https://shinydashboardplus.rinterface.com
Other
454 stars 77 forks source link

Controlbar not rendering properly with more than 3 items #144

Closed kelbakian closed 2 years ago

kelbakian commented 3 years ago

I'm attempting to fill a controlbar with 5 items (all of which are widgets,although this issue is present even in the simplest form). There are rendering issues in which there are 2 scrollbars present on some machines, as well as the controlbar not using enough space, causing 1+ tabs to not be visible. Additionally, using the controlbar causes a warning of "'bootstrapPage(position = )' is deprecated as of shiny 0.10.2.2. The 'position' argument is no longer used with the latest version of Bootstrap." Here is a small reproducible example of the error, as well as images of the issues. Note that this issue didn't occur before the last big update.

R_buggy_code

buggy_UI

warning_buggy_code

If images can't be viewed: here's the code you can use to recreate this error: library(shiny) library(shinydashboard) library(shinydashboardPlus) library(tidyverse) library(data.table)

ui <- dashboardPage(title="Example", header =dashboardHeader(title="Header",titleWidth=280), sidebar = dashboardSidebar(sidebarMenu(menuItem("MenuItem1",tabName="Item1"))), body = dashboardBody(tabItems(tabItem(tabName="Item1", fluidRow(box(dataTableOutput("outputdf")))))), controlbar = dashboardControlbar( controlbarMenu( controlbarItem(title="widget1"), controlbarItem(title="widget2"), controlbarItem(title="widget3"), controlbarItem(title="widget4"), controlbarItem(title="widget5") ) ) )

server <- function(input, output, session) {

}

shinyApp(ui=ui,server=server)

DivadNojnarg commented 3 years ago

Try adding width=500 to the dashboard controlbar:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(tidyverse)
library(data.table)

ui <- dashboardPage(title="Example",
                    header =dashboardHeader(title="Header",titleWidth=280),
                    sidebar = dashboardSidebar(sidebarMenu(menuItem("MenuItem1",tabName="Item1"))),
                    body = dashboardBody(tabItems(tabItem(tabName="Item1", fluidRow(box(dataTableOutput("outputdf")))))),
                    controlbar = dashboardControlbar(width = 500,
                        controlbarMenu(
                            controlbarItem(title="widget1"),
                            controlbarItem(title="widget2"),
                            controlbarItem(title="widget3"),
                            controlbarItem(title="widget4"),
                            controlbarItem(title="widget5")
                        )
                    )
)

server <- function(input, output, session) {

}

shinyApp(ui=ui,server=server)