Comments (8)
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.
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.
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.
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.
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.
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.
very useful and did the trick indeed. thank you very much once again.
from bsplus.
No problem!
from bsplus.
Related Issues (20)
- fix pkgdown
- Compatability with rstudio/bslib bootstrap version 4 or 5? HOT 3
- Compatibility with Bootstrap 5
- bsTooltip does not allow special characters
- fix CRAN issues
- Release bsplus 0.1.4 HOT 1
- Release bsplus 0.1.4
- Different tooltip behavior with htmlOutput()/renderUI()
- Customize colors
- Allow multiple panels to be open at one time HOT 3
- How can I add icons to bs_accordion headings HOT 2
- reactive bs_modal
- Limit to number of bstooltip that will show up?
- How to create bs_modal() in a loop in rmarkdown? HOT 1
- Stop carousel autoplay using Shiny and JavaScript
- `bsplus` only works for `html_document` but not `bookdown`?
- Error in .tag_validate(tag, name = "div", class = "form-group shiny-input-container")
- Usage of bs_embed_popover inside module
- Is this package still supported? HOT 1
- Release bsplus 0.1.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bsplus.