Skip to content

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

Description

@mengchen18

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!!!

Activity

  1. Swechhya commented on Aug 19, 2021

    @Swechhya
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions