Skip to content

shinydashboardPlus::boxSidebar : function arguments. #169

@svenb78

Description

@svenb78

Hello,

concerning the arguments of the boxSidebar function, there might be an issue.

The function looks like that:

function (..., id = NULL, width = 50, background = "#333a40", 
    startOpen = FALSE, icon = shiny::icon("cogs")) 
{
    stopifnot(width >= 25 && width <= 100)
    toolbarTag <- shiny::tags$button(id = id, `data-background` = background, 
        `data-width` = width, `data-widget` = "chat-pane-toggle", 
        `data-toggle` = "tooltip", `data-original-title` = "More", 
        `data-start-open` = tolower(startOpen), type = "button", 
        icon)
    contentTag <- shiny::tags$div(style = "z-index: 1; height: inherit;", 
        class = "direct-chat-contacts", shiny::tags$ul(class = "contacts-list", 
            shiny::tags$li(...)))
    shiny::tagList(toolbarTag, contentTag)
}

I think, it is the contentTag that refers to the sidebar box element (-> opened box). So, why does the function's width argument refer to the toolbarTag?

In fact, in a simple app, I had no problems using boxSidebar. In the context of a more complex app based on golem, the width of the opened sidebar box was always 100%, no matter what I used as argument. Also changing the value for the background argument did not work. So, I inspected the HTML and found, that manipulating the style tag works:

HTML

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions