Closed lgaborini closed 2 years ago
@lgaborini thanks for the report. Can you please install latest version and confirm you don't see the warning
Confirm fixed, thank you!
I am still getting this warning running version 3.0.0 of this package which looks to be the latest version on CRAN. It looks like this warning has transitioned or will soon be transitioning to an error (https://stackoverflow.com/questions/72848442/r-warning-lengthx-2-1-in-coercion-to-logical1), which is why I'm writing this here--I'm now getting an error in my shiny app upon clicking the button that triggers my shiny alerts when I wasn't before, and I think it's faulting this chunk in the shinyalert.R script:
if (html && !is.null(params[["text"]]) && (length(params[["text"]]) > 1 || nzchar(as.character(params[["text"]])))) { if (type == "input") { stop("Cannot use 'input' type and HTML together. You must supply your own Shiny inputs when using HTML.", call. = FALSE) }
It looks like how && and || work has shifted in recent updates of R and may now be breaking some previously working code? I see those operators in a few other lines in here also...
Using the reprex in this Thread, I still get a warning, not an error, FWIW.
Edit: Also FWIW, using the reprex here as a base, this is closer to my use case:
observeEvent(input$preview, {
string2show = paste0(c("Some amount<br>", "Of strings<br>", "Combined<br>"), collapse="")
# Show a modal when the button is pressed
shinyalert(
title = "Test",
html = TRUE,
div(HTML("Here's a list of all the lakes with records currently showing in the table: <br><br>", string2show),
class = "infoPopUpsText")
)
})
Still only produces a warning using this reprex but an error in my actual App. Not sure why. EDIT x2: Somehow my warn in options got set to > 2, so all warnings were elevated to errors (https://stackoverflow.com/questions/72754423/how-to-solve-error-converted-from-warning/72754921#72754921). Still, if this warning is going to become an error eventually, worth poking into! :)
Please install the latest dev/GitHub version, the fix is not on CRAN yet
A new version was submitted to CRAN today, it will be on CRAN in a few days
Simple reprex:
The warning is: