-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Guidelines
- I agree to follow this project's Contributing Guidelines.
Project Version
0.2.0
Platform and OS Version
I tested in windows and linux
Existing Issues
No response
What happened?
For context: I have to use a reactive dataset for a project. Since reactable_extras_server() is meant to receive a dataframe, I have to put it inside an observer.
However, once the reactive dataset gets modified and I try to sort a column, my app crashes.
Steps to reproduce
library(shiny)
library(reactable)
library(reactable.extras)
ui <- fluidPage(
selectInput("dataset", "Choose:", c("mtcars", "iris"), "mtcars"),
reactable_extras_ui("test")
)
server <- function(input, output, server) {
dataset <- reactive({
if (input$dataset =="mtcars") mtcars else iris
})
observe({
reactable_extras_server(
"test",
data = dataset(),
total_pages = ceiling(nrow(dataset())/10)
)
}) |>
bindEvent(dataset())
}
shinyApp(ui, server)Two ways to break:
-
Run code snippet. Starts with mtcars.
-
You can sort by any column (only for the current page, but that is a different problem)
-
Select the "iris" dataset. Crash
-
Run code snippet. Starts with mtcars.
-
Select the "iris" dataset.
-
Try to sort the table by the "Sepal.Length" column (or any column). Crash
...
Expected behavior
I expect to be able to sort the table without breaking the app
Attachments
This is the error message in the console
Warning: Error in dplyr::arrange: ℹ In argument: `..1 = Sepal.Length`.
Caused by error:
! object 'Sepal.Length' not found
64: <Anonymous>
63: signalCondition
62: signal_abort
61: abort
60: h
59: .handleSimpleError
58: eval
57: mask$eval_all_mutate
56: mutate_col
54: mutate_cols
53: mutate.data.frame
51: arrange_rows
50: arrange.data.frame
48: sort_table
45: ::
shiny
observe
44: <observer>
1: runApp
Screenshots or Videos
- Run code snippet. Starts with mtcars.
- You can sort by any column (only for the current page, but that is a different problem)
- Select the "iris" dataset. Crash
Grabacion.2024-06-10.112835.mp4
- Run code snippet. Starts with mtcars.
- Select the "iris" dataset.
- Try to sort the table by the "Sepal.Length" column (or any column). Crash
Grabacion.2024-06-10.112749.mp4
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working