insightsengineering / teal.slice

Reproducible slice module for teal applications
https://insightsengineering.github.io/teal.slice/
Other
11 stars 5 forks source link

[Bug]: filter state changes on app start #577

Open chlebowa opened 5 months ago

chlebowa commented 5 months ago

What happened?

When specifying initial filters, enumerating factor levels in a non-alphabetical order causes the app to change the filter state, which results in filter state history before the user changes the filter.

library(teal)

filter <- teal_slices(
  teal_slice("i", "Species", selected = c("virginica", "versicolor"))
)

data <- teal_data() |> within({
  i <- iris
  m <- mtcars
  f <- faithful
})
app <- init(data, example_module(), filter)

runApp(app)

image

After changing filter to

filter <- teal_slices(
  teal_slice("i", "Species", selected = c("versicolor", "virginica"))
)

image

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

Contribution Guidelines

Security Policy