Younes
Younes

Reputation: 129

R shiny: input can be selected through conditional panel

I want to have a full conditional panel over the app that I am building to function as a disclaimer. The conditional panel needs to cover the full screen until the user accepts the disclaimer. After that, the conditional panel clears and the user can use the app.

Currently, multiple inputs appear to be clickable though the conditional panel (radio buttons as well as a filter). When I select things in the filter, the app runs in the background). I don't want this to be possible. How can i get the conditional panel to cover the whole screen including all inputs?

    conditionalPanel(condition = 'input.disclaimerweg == ""',
                 absolutePanel(id = "disclaimer", class = "panel panel-default", fixed = TRUE,
                               draggable = FALSE, top = 41, left = 0, right = 0, bottom =  0,
                               width = "auto", height = "auto",
                               br(),
                               #actionButton("demoversie", "Demoversie"),
                               br(),
                               h1("Disclaimer!"),
                               actionButton("disclaimerweg", "Akkoord"),
                               br(),
                               br()

                 )
)

"Input can be selected through conditional panel

Upvotes: 0

Views: 324

Answers (1)

Carlos Vecina Tebar
Carlos Vecina Tebar

Reputation: 370

I'm not sure if i'm understanding your question, but you can put your buttons inside other conditional Panel that meet the oposite condition:

conditionalPanel(condition = 'input.disclaimerweg == ""',
             absolutePanel(id = "disclaimer", class = "panel panel-default", fixed = TRUE,
                           draggable = FALSE, top = 41, left = 0, right = 0, bottom =  0,
                           width = "auto", height = "auto",
                           br(),
                           #actionButton("demoversie", "Demoversie"),
                           br(),
                           h1("Disclaimer!"),
                           actionButton("disclaimerweg", "Akkoord"),
                           br(),
                           br()

             )
)

  conditionalPanel(condition = 'input.disclaimerweg != ""',
  # Input: Select a file ----
  fileInput("fileUploaded", "Choose CSV File",
            multiple = FALSE,
            accept = c("text/csv",
                       "text/comma-separated-values,text/plain",
                       ".csv"))
)

Then the buttons only appear when the user click the banner. Hope it helps!

Upvotes: 1

Related Questions