insertUI does not insert when there is a period in selector id. The shiny widget is rendered and a period is acceptable in input name, but not for insertUI. Is this expected? Is the period telling selector the text following is a class? Periods are valid in html id names, so would be helpful to note this invalid character.
shiny::runGist("69bd42177ad38b1272faaa7970eafb53")
library(shiny)
ui <- fluidPage(
mainPanel(
textInput(inputId = "abc", label = "first"),
textInput(inputId = "abc.1", label = "second")
)
)
server <- function(input, output) {
observeEvent(input$abc,{
print("output_works_first")
insertUI(
selector = "#abc",
where ="afterEnd",
ui = tags$div(tags$h4("Works"))
)
})
observeEvent(input$abc.1,{
print("output_works_second")
insertUI(
selector = "#abc.1",
where ="afterEnd",
ui = tags$div(tags$h4("Doesn't work"))
)
})
}
# Run the application
shinyApp(ui = ui, server = server)