New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bsModal doesn't open when trigger is inside renderUI #57
Comments
It should work, although I have not checked your code, because I did it in my app. 发自我的 iPhone
|
Well, it should, but it doesn't for me. What versions of |
@bartekch I just checked your code. Sorry, it's true that it won't work. But, it will work if you write it like this, which is moving the modal to the server part: library("shiny")
library("shinyBS")
ui <- fluidPage(
uiOutput("button_ui")
)
server = function(input, output, session) {
output$button_ui <- renderUI({
tagList(
bsModal("modal", "foo", trigger = "a", "bar"),
actionButton("a", "Show modal")
)
})
}
runApp(list(ui = ui, server = server)) I think the problem happens if you generate the If you really need to set the |
@shrektan thanks for showing this problem to me, I hasn't been aware of this limitation. Yes, defining modal in the same place as trigger could be solution. However I have quite a lot of modals in my app and I want to define them in separate place (inside Using
It's a few lines of code more, but it's working no matter where I put modal definition. Anyway it would be nice to have |
I've discovered that when trigger for modal is defined not in UI directly, but through
uiOutput
andrenderUI
mechanism, it doesn't work. Here the minimal example that isn't working.I've tried to manually add additional attributes to
actionButton
:but it hasn't changed anything.
Any ideas why it is so?
Here my session info:
The text was updated successfully, but these errors were encountered: