Closed SCasanova closed 1 year ago
Yes that make sense because you can't run it outside the shiny app server function:
shinyMobile::f7Popup(id = "popup1")
Please look at this example from the documentation:
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
title = "Popup",
f7SingleLayout(
navbar = f7Navbar(
title = "f7Popup",
hairline = FALSE,
shadow = TRUE
),
f7Button("togglePopup", "Toggle Popup")
)
),
server = function(input, output, session) {
output$popupContent <- renderPrint(input$text)
observeEvent(input$togglePopup, {
f7Popup(
id = "popup1",
title = "My first popup",
f7Text("text", "Popup content", "This is my first popup ever, I swear!"),
verbatimTextOutput("popupContent")
)
})
observeEvent(input$popup1, {
popupStatus <- if (input$popup1) "opened" else "closed"
f7Toast(
position = "top",
text = paste("Popup is", popupStatus)
)
})
}
)
Every time I try to use
f7Popup()
I get the following, regardless of use:R Version: 4.2.2 shinyMobile Version: 1.0.0 shiny Version: 1.7.4
Created on 2023-08-09 with reprex v2.0.2