Skip to content
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

[Bug]: Issues when rendering tabset #440

Open
1 task done
federiva opened this issue Jun 13, 2023 · 0 comments
Open
1 task done

[Bug]: Issues when rendering tabset #440

federiva opened this issue Jun 13, 2023 · 0 comments
Labels

Comments

@federiva
Copy link
Contributor

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

0.4.3

Platform and OS Version

Ubuntu 22.04

Existing Issues

#39

What happened?

Tabset is not being rendered as described in #63

library(shiny)
library(shiny.semantic)
library(rhandsontable)

# Sample data for the tables
data1 <- data.frame(Name = c("John", "Alice", "Bob"), Age = c(28, 24, 22))
data2 <- data.frame(Product = c("A", "B", "C"), Price = c(10, 20, 30))

# UI
ui <- semanticPage(
  title = "Example Issue 39",
  textOutput("text"),
  tabset(
    id = "tabset",
    tabs = list(
      # Content of Tab 1
      list(
        menu = "tab_1",
        content = tags$div(
          class = "ui segment",
          h1("Content of Tab 1"),
          rHandsontableOutput("tab1_table")
        ),
        id = "a_tab_1"
      ),
      # Content of Tab 2
      list(
        menu = "tab_2",
        content = tags$div(
          class = "ui segment",
          h1("Content of Tab 2"),
          rHandsontableOutput("tab2_table")
        ),
        id = "a_tab_2"
      )
    )
  )
)

# Server
server <- function(input, output, session) {
  # Content for Tab 1
  output$tab1_table <- renderRHandsontable({
    rhandsontable(data1)
  })
  # outputOptions(output, "tab1_table", suspendWhenHidden = FALSE)
  
  output$tab2_table <- renderRHandsontable({
    rhandsontable(data2)
  })
  # outputOptions(output, "tab2_table", suspendWhenHidden = FALSE)
  

  output$text <- renderText({
    paste(length(input$tab1_table), length(input$tab2_table))
  })
}

# Run the app
shinyApp(ui = ui, server = server)

Steps to reproduce

Scenario 1 not working

  1. Run the example app submitted in the description
  2. Check that the numbers above the tabset being rendered are 3 0

Scenario 2 - Working example using outputOptions

  1. In the app provided in the description uncomment the lines in which outputOptions is used
  2. Run the app
  3. Check that the numbers above the tabset are 3 3 (This indicates that the tables are being rendered appropriately)
    ...

Expected behavior

Tabset should render

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

@federiva federiva added the bug label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant