title: shinyFiles folder selection: display the default folder
body: <p>I need to display selected folder for Shiny users, and I asked here how to do this (<a href="https://stackoverflow.com/questions/47719285/display-selected-folder-path-in-shiny">Display selected folder path in Shiny</a>). It works but now I can't figure out how to show the default folder (for example, current directory) before the selection was made. </p>
  
  <pre><code>library(shiny)
  library(shinyFiles)
  
  ui &lt;- fluidPage( # Application title
    mainPanel(
      shinyDirButton("dir", "Input directory", "Upload"),
      verbatimTextOutput("dir", placeholder = TRUE)  
    ))
  
  server &lt;- function(input, output) {
    shinyDirChoose(
      input,
      'dir',
      roots = c(home = '~'),
      filetypes = c('', 'txt', 'bigWig', "tsv", "csv", "bw")
    )
  
    dir &lt;- reactive(input$dir)
    output$dir &lt;- renderText({  
      parseDirPath(c(home = '~'), dir())
    })
  ## change smth here... if output$dir is null, display getwd() but it doesn't work
  
    observeEvent(ignoreNULL = TRUE,
                 eventExpr = {
                   input$dir
                 },
                 handlerExpr = {
                   home &lt;- normalizePath("~")
                   datapath &lt;&lt;-
                     file.path(home, paste(unlist(dir()$path[-1]), collapse = .Platform$file.sep))
                 })
  }
  
  # Run the application
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>I can think only of a conditional panel displaying some text if the folder wasn't selected. But I guess there should a better way to do this. Thank you!</p>