diff --git a/R/reactable2.R b/R/reactable2.R index 9b26a78..d274e72 100644 --- a/R/reactable2.R +++ b/R/reactable2.R @@ -50,14 +50,15 @@ reactable2 <- function(data, if (download) { on_click <- paste0("Reactable.downloadDataCSV('", element_id, "')") - tbl <- htmltools::browsable( + htmltools::browsable( htmltools::tagList( htmltools::tags$button("Download as CSV", onclick = on_click), tbl ) ) + } else { + tbl } - attr(tbl, "data") <- tbl$data }