rshinyshinytree

R Shiny - clicking shinyTree expanding icon close parent dropdown modal


I am using library shinyTree and shinyWidgets. The problem is that if I put the hierarchical checkbox on the dropdown modal, the double clicking of the tree expanding icon (see the red circle in the following figure) will close the parent dropdown modal.

enter image description here

Any solution regarding this?

Full source code:

server.R

library(shiny)
library(shinyTree)
library(shinyWidgets)

shinyServer(function(input, output, session) {
  output$shinyTreeTest <- renderUI({ 
    dropdown(
      shinyTree("tree", checkbox = TRUE),
      style = "unite", label = "Location", width = "300px", circle=FALSE
    )
  })

  output$tree <- renderTree({ 
    list(  'I lorem impsum'= list( 
      'I.1 lorem impsum'   =  structure(list('I.1.1 lorem impsum'='1', 'I.1.2 lorem impsum'='2'),stselected=TRUE),  
      'I.2 lorem impsum'   =  structure(list('I.2.1 lorem impsum'='3'), stselected=TRUE)))

  })
})

ui.R

library(shiny)
library(shinyTree)

shinyUI(
  shiny::fluidPage(
    h4('Shiny hierarchical checkbox')
    ,uiOutput("shinyTreeTest")
  )
)

Solution

  • I also posted this question on GitHub shinyWidget project and got the answer from there. The problem has been solved by reinstalling shinyWidget from devtool rather than CRAN.