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

Reactable pagination switches to page one on selection with crosstalk object #349

Open
msaltieri opened this issue Nov 24, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@msaltieri
Copy link

Hi @glin and thanks for the nice work!

I'm not sure if this is an issue with reactable or with crosstalk but I'm raising it just because it's a pretty annoying bug.

When utilizing a crosstalk object within a reactable featuring row selection, an unexpected behavior occurs where, upon selecting a row on a page greater than 1, the reactable pagination immediately switches to page one.

Thank you for any help you could provide!

Reproducible example

library(shiny)
library(crosstalk)
library(reactable)

ui <- fluidPage(
  titlePanel("Test Reactable With Crosstalk"),
  fluidRow(
    column(
      12,
      reactableOutput("tab")
    )
  )
)

server <- function(input, output) {
  data <- SharedData$new(cars)
  output[["tab"]] <- renderReactable(
    reactable(
      data = data,
      selection = "multiple"
    )
  )
}

shinyApp(ui = ui, server = server)

Expected Behavior

The pagination should not switch to page one upon selecting a row. The selected row should remain highlighted, allowing the user to continue interacting with the reactable on the current page.

Actual Behavior

Upon selecting a row on a page greater than 1, the pagination immediately switches to page one.

Session Info

version  R version 4.3.2 (2023-10-31)
os       macOS Sonoma 14.0
system   x86_64, darwin20
ui       RStudio
language (EN)
collate  it_IT.UTF-8
ctype    it_IT.UTF-8
tz       Europe/Rome
date     2023-11-24
rstudio  2023.09.1+494 Desert Sunflower (desktop)
pandoc   2.15 @ /usr/local/bin/pandoc

Additional Information

@glin
Copy link
Owner

glin commented Jan 29, 2024

Hi @msaltieri, thanks for the report. I think it's a bug in reactable. I've got a test branch up with a possible fix that I still need to confirm, but you could try it if you're able to install a development version: https://github.com/glin/reactable/compare/crosstalk-select?expand=1

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

No branches or pull requests

2 participants