JohnCoene / tippy

💬 Tippy.js for Shiny
http://tippy.john-coene.com/
Other
76 stars 2 forks source link

with_tippy: options are not effective #14

Closed dmenne closed 3 years ago

dmenne commented 3 years ago

Tooltip works, but none of the options is effective; placement or theme are not used

library(shiny)
library(tippy)

shinyApp(
  ui = fluidPage(
    h1("Tipply options do not work"),
    with_tippy(textInput("input", "input with tooltip"), 
       "Input text", placement = "bottom", theme = "light"
     )

  ),
  server = function(input, output) {}
)

library(shiny)
library(tippy)

shinyApp(
  ui = fluidPage(
    h1("Tipply options do not work"),
    with_tippy(textInput("input", "input with tooltip"), 
       "Input text", placement = "bottom", theme = "light"
     )
  ),
  server = function(input, output) {}
)

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tippy_0.1.0 shiny_1.6.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6             withr_2.4.2            digest_0.6.27          later_1.2.0           
 [5] mime_0.11              R6_2.5.0               jsonlite_1.7.2         lifecycle_1.0.0       
 [9] xtable_1.8-4           magrittr_2.0.1         cachem_1.0.5           rlang_0.4.11.9000     
[13] cli_2.5.0              promises_1.2.0.1       jquerylib_0.1.4        bslib_0.2.5.9002      
[17] ellipsis_0.3.2         tools_4.1.0            htmlwidgets_1.5.3.9000 yaml_2.2.1            
[21] httpuv_1.6.1           fastmap_1.1.0          compiler_4.1.0         htmltools_0.5.1.9005  
[25] sass_0.4.0 
dmenne commented 3 years ago

Workaround: use tippy_this


library(shiny)
library(tippy)

shinyApp(
  ui = fluidPage(
    h1("Tipply options do not work"),
    with_tippy(textInput("input", "input with tooltip"), 
       "Input text", placement = "bottom", theme = "light"
     ),
    textInput("mytext", "A label"),
    tippy_this("mytext", "Tippy_this tooltip", placement = "bottom",theme = "light")
  ),
  server = function(input, output) {}
)
JohnCoene commented 3 years ago

I just pushed a fix to the dev version, if you don't mind trying.

dmenne commented 3 years ago

Thanks, John, I assume you mean the master branch (there is no dev).

Work fine. Looks like you increased the text size a bit, which is a good idea. There is still some debug output:

$selector
[1] "#tippy-c7nf83iq62zvbsjptyoe"

$options
$options$content
[1] "Input text"
JohnCoene commented 3 years ago

Thanks, Just removed it.