You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a popup is created, closed, and opened a second time, console logs an error "Uncaught Duplicate binding for ID popupContent". Once it is closed again you can't open it any more. Using javascript to close it results in a similar situation. I also tried to destroy the popup after closing it, but that didn't work either.
I assume this is because the popup instance is created anew every time, but doesn't get destroyed as it doesn't have an id in DOM, or something like that?
Running a modified example from f7Popup should reproduce the problem for both the default popup closing and using javascript.
if (interactive()) {
library(shiny)
library(shinyMobile)
library(shinyjs)
shinyApp(
ui = f7Page(
title = "Popup",
f7SingleLayout(
useShinyjs(),
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!"),
f7Button("closePopup", "Close Popup"),
verbatimTextOutput("popupContent")
)
})
observeEvent(input$closePopup, {
runjs("app.popup.get('.popup').close(true);")
runjs("app.popup.get('.popup').destroy();")
})
observeEvent(input$popup1, {
popupStatus <- if (input$popup1) "opened" else "closed"
f7Toast(
position = "top",
text = paste("Popup is", popupStatus)
)
})
}
)
}
Hi, have you found a solution for this? I have popups in my app that need to be closed programmatically and can't put them on an F7Sheet because there is too much content without having an overflow. I haven't found any modals to use as an alternative (like shinyBS) that are compatible with shinyMobile.
If a popup is created, closed, and opened a second time, console logs an error "Uncaught Duplicate binding for ID popupContent". Once it is closed again you can't open it any more. Using javascript to close it results in a similar situation. I also tried to destroy the popup after closing it, but that didn't work either.
I assume this is because the popup instance is created anew every time, but doesn't get destroyed as it doesn't have an id in DOM, or something like that?
Running a modified example from f7Popup should reproduce the problem for both the default popup closing and using javascript.
sessionInfo()
Also, I'd really find it useful if it still were possible to close a popup with a function like f7TogglePopup.
The text was updated successfully, but these errors were encountered: