rstudio/miniUI

Possible bug in getting the currently selected tab in a gadget using miniTabstripPanel

Opened this issue · 6 comments

For some reason I can't seem to figure out how to get the value of the selected tab in a shiny gadget. I thought it'd be straight forward, but this isn't working. Not sure if there's a bug, or if I'm missing something.

library(shiny)
library(miniUI)

ui <- miniPage(
  miniTabstripPanel(
    id = "mytabs",
    miniTabPanel("Tab 1", value = "tab1", "tab 1"),
    miniTabPanel("Tab 2", value = "tab2", "tab 2"),
    miniTabPanel("Tab 3", value = "tab3", "tab 3")
  )
)

server <- function(input, output, session) {
  observe({
    cat(input$mytabs)
  })
}

runGadget(ui, server)

It seems the CRAN version of this package still has this bug. Also for the dev version, the value argument for miniTabPanel seems useless, the title is always the return value.

@bborgesr you can take a look if you want :)

vnijs commented

Although it would be indeed be nice to be able to set a value for a tab panel as @daattali and @qinzhu requested, I'd be happy to get the dev version on CRAN. The current release doesn't seem to provide any return value for a tab

It looks like this is still an issue. I can't seem to get the id field to work with miniTabstripPanel to identify the active tab.

Did anyone find a workaround for identifying the active tab?

This still doesn't behave how its docs say it does. Using the full name (even with spaces) does work, though.