Shiny input label embed and radio group buttons
Closed this issue · 7 comments
I am not able embed an icon and attach a modal to radioGroupButtons input type tag developed by shinywidgets @pvictor. Is this something that can be easily fixed?
ERROR: class is: form-group shiny-input-container shiny-input-radiogroup shiny-input-container-inline, needs to be: form-group shiny-input-container
Can you provide a minimal reproducible example? It would help me to figure out possible-next-steps. You might find the reprex package to be useful.
Sure, here goes.
library(shiny)
require(bsplus)
require(shinyWidgets)
modal_features <-
bs_modal(
id = "modal_features",
title="Features",
body= "test",
size="medium"
)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
radioGroupButtons(inputId = "plot_type",label="Plot type",
choices = c("A","B"),
justified = TRUE,status="primary") %>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_attach_modal(id_modal = "modal_features")
)
),
mainPanel = verbatimTextOutput("text")
)
)
server <- function(input, output) {
output$text <- renderText({
as.character(input$plot_type)
})
}
# Run the application
shinyApp(ui = ui, server = server)
#>
#> Error in .tag_validate(tag, name = "div", class = "form-group shiny-input-container") :
#> class is: form-group shiny-input-container shiny-input-radiogroup shiny-input-container-inline,
#> needs to be: form-group shiny-input-container
Created on 2019-02-19 by the reprex package (v0.2.1)
Hi @kaushik12 - thanks for the reprex! This helped me see that an internal function, .tag_validate()
, needed to be more-permissive about the classes, then helped me test that it was fixed.
Thanks a lot Ian for a quick turnaround! Appreciate the help!
Hi I ran into the same bug using the CRAN version of bsplus. Now using the github version, which works fine.
Question: any chance of having the CRAN version patched too ? Cheers
Yes - it's overdue for a release! Let me see what I can do...