You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, it has compatibility problem on Quarto doc. The choices argument should be used to define the character vector to select a value from, but Quarto doc doesn't recognizes it and keeps showing a default range from 10 to 100, not matter what range I set, or if I use character vector instead.
Below is my example (you can paste these codes into a blank quarto doc and reproduce it):
---
title: "Slider Text Input Example"
format: html
server: shiny
execute:
warning: false
---
```{r}
library(shiny)
library(shinyWidgets)
sliderTextInput("Id095", "Choose a letter:",
choices = c("a", "b", "c", "d", "e"))
textOutput("selected_letter")
```
```{r}
#| context: server
output$selected_letter <- renderText({
paste("You have selected the letter:", input$Id095)
})
```
Screenshots
Here is a screenshot of a successful implementation on the ShinyApp:
Here is another screenshot of Quarto Doc. You can see the range is set as from 10 to 100, which is probably a default value. I tried to set a custom range with a character vector but it was ignored:
If anyone encountered with the same issue, or if you have a solution, please comment below. I appreciate your help!
The text was updated successfully, but these errors were encountered:
pingfan-hu
changed the title
sliderTextInput compatibility problem on Quarto doc in the argument choices.sliderTextInput compatibility problem on Quarto doc in the argument choices.
Apr 15, 2024
Yeah this is a relatively rare problem and will only occur when you want to use shiny as server on your qmd file. In usual cases people use the ShinyApp and it works out fine. Hopefully the shinyWidgets team could provide some guidance to us.
ShinyApp Works Fine
The
sliderTextInput
function works out fine on ShinyApp, like this:Quarto Doc Not Compatible
However, it has compatibility problem on Quarto doc. The
choices
argument should be used to define the character vector to select a value from, but Quarto doc doesn't recognizes it and keeps showing a default range from 10 to 100, not matter what range I set, or if I use character vector instead.Below is my example (you can paste these codes into a blank quarto doc and reproduce it):
Screenshots
Here is a screenshot of a successful implementation on the ShinyApp:
Here is another screenshot of Quarto Doc. You can see the range is set as from 10 to 100, which is probably a default value. I tried to set a custom range with a character vector but it was ignored:
If anyone encountered with the same issue, or if you have a solution, please comment below. I appreciate your help!
The text was updated successfully, but these errors were encountered: