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

In shiny app, when a column is deleted, the column header is not deleted accordingly. Results in an error when call "Excel_to_R" function. #91

Open
mengchen18 opened this issue Mar 25, 2021 · 1 comment
Labels
bug Something isn't working can't reproduce

Comments

@mengchen18
Copy link

This seems like a bug:

Describe the bug
In shiny app, when a column is deleted, the column header is not deleted accordingly. Results in an error when call "Excel_to_R" function.

To Reproduce
Steps to reproduce the behavior:

library(excelR)
library(shiny)

ui <- fluidPage(
  excelOutput("tab")
)

server <- function(input, output, session) {
  df <- data.frame(
    l = c("A", "B"),
    n = 1:2,
    stringsAsFactors = FALSE
  )
  output$tab <- renderExcel(
    excelTable(df)
  )
  
  observe(
    print(input$tab)
  )
}

shinyApp(ui, server)

Delete the second column from the shiny app, then the console prints:

$data
$data[[1]]
$data[[1]][[1]]
[1] "A"

$data[[2]]
$data[[2]][[1]]
[1] "B"

$col Headers
$colHeaders[[1]]
[1] "l"

$colHeaders[[2]]
[1] "n"

$colType
$colType[[1]]
[1] "text"

$forSelectedVals
[1] FALSE

Expected behavior
Please note there are still two elements in the "colHeaders", it should return sth like this:

$data
$data[[1]]
$data[[1]][[1]]
[1] "A"

$data[[2]]
$data[[2]][[1]]
[1] "B"

$colHeaders
$colHeaders[[1]]
[1] "l"

$colType
$colType[[1]]
[1] "text"

$forSelectedVals
[1] FALSE

Thanks for you work!!! excelR is great!!!

@Swechhya Swechhya added the bug Something isn't working label Apr 22, 2021
@Swechhya
Copy link
Owner

@mengchen18 Can you please specify the version of excelR you are using? I can't replicate this issue in the latest development version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can't reproduce
Projects
None yet
Development

No branches or pull requests

2 participants