datastorm-open/shinymanager

fab_position = "bottom-left" removes logout button

FreyGeospatial opened this issue · 2 comments

Use "test" for username and password to enter the app. Logout button does not appear in Chrome, Firefox, or Edge. Commenting out fab_position = "bottom-left" makes the button re-appear in the default bottom-right position.

if (interactive()) {
  library(shiny)
  library(DT)
  library(shinymanager)
  library(bs4Dash)
  
  credentials <- data.frame(
    user = c("test"),
    password = c("test"), 
    stringsAsFactors = FALSE
  )
  
  shinyApp(
    ui = secure_app(fab_position = "bottom-left",
      dashboardPage(
      
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        
        fluidRow(column(12, DT::dataTableOutput('mytable')))
      ),
      footer = dashboardFooter()
    )),
    server = function(input, output) {
      result_auth <- secure_server(check_credentials = check_credentials(credentials))
      output$mytable <- DT::renderDataTable(iris,
                                            #extensions = "FixedHeader",
                                            #style="bootstrap",
                                            options = list(
                                              dom = 't',
                                              lengthMenu = c(50, 100),
                                              pageLength = 20,
                                              scrollX=TRUE,
                                              autoWidth = TRUE,
                                              paging=TRUE,
                                              searching=FALSE,
                                              ordering=TRUE
                                              #fixedHeader = TRUE,
                                            ))
    }
  
  )
}

Thanks for the example. It seems that the button is hidden by the sidebar, you can make it appear by adding :

tags$style(".mfb-component--bl {z-index: 9999;}")

in your UI (inside dashboardBody() for example).

We will update our own CSS to fix the problem in next release.

Victor

Sweet, thanks for the quick follow-up! Happy to have brought this to your attention.