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

Sidebar open parameter crash Shinylive when passing a list #1081

Closed
cedricbouffard opened this issue Jul 5, 2024 · 3 comments · Fixed by #1088
Closed

Sidebar open parameter crash Shinylive when passing a list #1081

cedricbouffard opened this issue Jul 5, 2024 · 3 comments · Fixed by #1088
Milestone

Comments

@cedricbouffard
Copy link

When passing a list to the open parameter in a sidebar, shinylive will display this error:
image

I tried with a named character vector, same problem.

Here's a sample code:

library(shiny)
library(bslib)

ui <- page_sidebar(

  sidebar = sidebar(
    open = list(desktop = "always", mobile = "open")
  ),
  mainPanel(
    "Test"
  )
)

server <- function(input, output, session) {
 
  }
  


shinyApp(ui, server)
@gadenbuie
Copy link
Member

I wonder if there's an encoding issue? I just copied your example into shinylive and it worked as expected. (I edited it lightly in that link but the direct copy works as well.)

I noticed that the error message appears to say

Error: `open` must be one of "desktop", "open", "closed", or "always", not "always".

which seems to indicate there's a difference between "always" and "always"?

gadenbuie added a commit that referenced this issue Jul 11, 2024
Fixes #1081
We manually provide values to `rlang::arg_match()`, so vector input values throw
@gadenbuie gadenbuie added this to the v0.8.0 milestone Jul 11, 2024
@gadenbuie
Copy link
Member

Oh, actually I think I found the bug! I'm not sure which exact conditions produce the error, but I ran into it myself and know how to fix it :)

Copy link

This issue has been automatically locked. If you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue.
🙋 Need help? Connect with us on Discord or Posit Community.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants