Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

shinyBS - remove tooltip when dragging

$
0
0

I'm using dragulaR to create draggable divs in Shiny, and added a tooltip using shinyBS to each div. I was wondering if it's possible to remove the tooltip (I tried adding jQuery from JQuery UI: remove Bootstrap tooltip on a draggable clone when drag starts?) when dragging the div?

library(shiny)
library(dragulaR)
library(shinyBS)

makeElement <- function(data, name)
{
  div(style = "border-width:2px;border-style:solid;",
      drag = name,
      div(class = "active-title-row", id = name, name),
          bsTooltip(id = name, title = "Hover",
                    placement = "top", trigger = "hover"))
}

ui <- fluidPage(

  # Maybe something like this but it doesn't work
  tags$script(HTML(
    "$(function() {
    start: function(event, ui) {             
      $('#bsTooltip').hide();             
    });"
  )),

  titlePanel("Drag and drop elements with dragulaR"),

  fluidRow(style = "margin: 15px;",
           column(3,
                  h3("Drag from here:"),
                  div(id = "Available", style = "min-height: 600px;",
                      lapply(colnames(mtcars), makeElement, data = mtcars))
           ),
           column(3,
                  h3("Drop here:"),
                  div(id = "Model", style = "min-height: 600px;")
           )
  ),
  dragulaOutput("dragula")

)

server <- function(input, output) {

  output$dragula <- renderDragula({
    dragula(c("Available", "Model"))
  })

}

shinyApp(ui = ui, server = server)

Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>