Open nilaiqigenicheng opened 2 years ago
this is a part of my cord , I am using package 'shinyWidgets' here .
radioGroupButtons(
inputId = "datatype",
label = NULL,
choices = c("upload data"="a", "sample data"="b"),
checkIcon = list(
yes = tags$i(class = "fa fa-check-square",
style = "color: green"),
no = tags$i(class = "fa fa-square-o",
style = "color: green"))
),
tippyThis("datatype", "Choose how to enter data"),
And I found that it is normal sometimes , such as:
actionBttn(
inputId = "view_sam_data",
label = "View DATA",
style = "material-flat",
color = "success",
icon = icon("eye")
),
tippyThis(
"view_sam_data",
"Browse all sample data"
)
This is also the case for any minimal reproducible example. In the following example the tooltip appears in the middle of the screen regardless of the browser.
library(shiny)
library(tippy)
shinyApp(
ui = fluidPage(
tippy(
element = p("Test"),
content = "Tooltip"
)
),
server = function(input, output) {}
)
Appears to be an issue with inline elements. Discussed here on Stack Overflow: https://stackoverflow.com/questions/70211827/position-tippy-tooltip-next-to-button-in-r-shiny/70220872
Sorry I had not seen this issue on stackoverflow.
This is not an error the elements that has the tooltip actually takes the entire width of the page. You could give the element a certain width (not advised).
library(shiny)
library(tippy)
shinyApp(
ui = fluidPage(
tippy(
element = p("Test", style = "width:20px;"),
content = "Tooltip"
)
),
server = function(input, output) {}
)
Better, use placement
library(shiny)
library(tippy)
shinyApp(
ui = fluidPage(
tippy(
element = p("Test"),
content = "Tooltip",
placement = "top-start"
)
),
server = function(input, output) {}
)
Thank you for the package ,This package is very useful for me. Thank you again! When my UI part is leaning to the side, it cannot be displayed accurately on top of the UI part ,I just follow the example to write my code