Skip to content

tabsetPanel doesn't work in React context #64

@kamilzyla

Description

@kamilzyla

Reproducible example

shinyApp(
  ui = bootstrapPage(
    shiny.react:::ReactContext(
      tabsetPanel(
        id = "tabset",
        selected = "tab2",
        tabPanel("tab1", "Tab 1"),
        tabPanel("tab2", "Tab 2")
      )
    )
  ),
  server = function(input, output) {
    observe(dput(input$tabset))
  }
)

Problems

  1. After initially loading the app, no tab is selected. Removing selected = "tab2" doesn't change this.
  2. It is possible to click on the tab to select it, but it won't be sent to the server (input$tabset is NULL).

Expected behavior

The app should behave as it would if we replaced shiny.react:::ReactContext() with div():

  1. The tab passed as selected argument should be actually selected when the application is initially loaded.
  2. The currently selected tab should be available on the server as input$tabset.

Notes

Replacing shiny.react:::ReactContext() with shiny.react:::ShinyBindingWrapper() seems to resolve problem (2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions