Giter Site home page Giter Site logo

Comments (8)

dylancis avatar dylancis commented on August 25, 2024

After further tests the issue is everywhere where bs_embed_tooltip is used. once you click on a widget with the tooltip added this way, the tooltip will persists until you click somewhere on the screen.

from bsplus.

ijlyttle avatar ijlyttle commented on August 25, 2024

Sorry for not responding sooner.

My first thought is that this may be something that needs to be resolved at the Bootstrap level. This package can provide access to the Bootstrap API and show some examples, but I don't think it can do much beyond that.

Does the tooltip for the "Label with tooltip help" input at this app behave the way that you expect?

If so, could the shinyInput_label_embed() function be useful to you?

from bsplus.

dylancis avatar dylancis commented on August 25, 2024

Thanks @ijlyttle , shinyInput_label_embed() was indeed very much helpful.
I was able to replace all of them in my app using this feature. However while it works fine in UI, how can we use it on the server side instead? I was hopping shinyInput_label_embed() had an id attribute so I can use shinyBS::addTooltip() on server side but I could not find a way to attached an id to this.

from bsplus.

ijlyttle avatar ijlyttle commented on August 25, 2024

Glad it helped! I have just pushed a update so that shiny_iconlink has an id.

Would (does) something like this work for you?

On the UI side

numericInput(inputId = "foo", label = "Enter a number", value = 0) %>%
  shinyInput_label_embed(
    shiny_iconlink(name = "info", id = "foo_help") 
  )

On the server side:

shinyBS::addTooltip(id = "foo_help", ...)

from bsplus.

dylancis avatar dylancis commented on August 25, 2024

Thank you very much @ijlyttle for your quick reply and update, I actually do not use shiny_iconlink() but selectInput(inputId = "portQualityGB", label = "Portfolio quality", choices = c("Bad", "Moderate", "Good"),selected = "Moderate") %>% shinyInput_label_embed(icon("info"))

Anything I could mirror from your above suggestion maybe ? I greatly appreciate your help on this.

from bsplus.

ijlyttle avatar ijlyttle commented on August 25, 2024

I think you should consider using shiny_iconlink() because:

  • it wraps shiny::icon() in a link because tooltips and popovers (as I understand) like to operate on elements like links and buttons.
  • it provides you with the means to supply an id

Here's the code:

> bsplus::shiny_iconlink
function(name = "info-circle", id = NULL, ...){

  if (!requireNamespace("shiny", quietly = TRUE)) {
    stop(
      "Shiny needed for this function to work. Please install it.",
      call. = FALSE
    )
  }

  htmltools::tags$a(shiny::icon(name = name, ...), id = id, href = "#")
}
<environment: namespace:bsplus>

from bsplus.

dylancis avatar dylancis commented on August 25, 2024

very useful and did the trick indeed. thank you very much once again.

from bsplus.

ijlyttle avatar ijlyttle commented on August 25, 2024

No problem!

from bsplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.