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

[Bug]: Opening the Available filters clears the filter state completely + It does not display slices to select from. #595

Open
3 tasks done
vedhav opened this issue May 24, 2024 · 0 comments
Labels
bug Something isn't working core

Comments

@vedhav
Copy link
Contributor

vedhav commented May 24, 2024

What happened?

In a non-teal shiny app with the filter panel, clicking the Available filters clears the active filters initialised during init. Maybe this is not a bug and it has to do with how the initial state was set because the clearing bug is gone after new filters are added after it's been cleared like this.

Screenshot 2024-05-24 at 3 09 23 PM

The second bug is that the available filters are not rendered.
Screenshot 2024-05-24 at 3 14 40 PM

Example app to test

library(shiny)
library(teal.slice)

datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))


ui <- fluidPage(
  fluidRow(
    column(
      width = 9,
      dataTableOutput("iris_table")
    ),
    column(width = 3, datasets$ui_filter_panel("filter_panel"))
  )
)
server <- function(input, output, session) {
  datasets$srv_filter_panel("filter_panel")
  set_filter_state(
    datasets = datasets,
    filter = teal_slices(
      teal_slice(dataname = "iris", varname = "Species", selected = "virginica", keep_na = FALSE)
    )
  )
  iris_filtered_data <- reactive(datasets$get_data(dataname = "iris", filtered = TRUE))
  output$iris_table <- renderDataTable(iris_filtered_data())
}

shinyApp(ui, server)

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@vedhav vedhav added bug Something isn't working core labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

1 participant