Change the value of a stepper input on the client
updateF7Stepper( inputId, min = NULL, max = NULL, value = NULL, step = NULL, fill = NULL, rounded = NULL, raised = NULL, size = NULL, color = NULL, wraps = NULL, decimalPoint = NULL, autorepeat = NULL, manual = NULL, session = shiny::getDefaultReactiveDomain() )
inputId | The id of the input object. |
---|---|
min | Stepper minimum value. |
max | Stepper maximum value. |
value | Stepper value. Must belong to \[min, max\]. |
step | increment step. 1 by default. |
fill | Whether to fill the stepper. FALSE by default. |
rounded | Whether to round the stepper. FALSE by default. |
raised | Whether to put a relied around the stepper. FALSE by default. |
size | Stepper size: "small", "large" or NULL. |
color | Stepper color: NULL or "red", "green", "blue", "pink", "yellow", "orange", "grey" and "black". |
wraps | In wraps mode incrementing beyond maximum value sets value to minimum value, likewise, decrementing below minimum value sets value to maximum value. FALSE by default. |
decimalPoint | Number of digits after dot, when in manual input mode. |
autorepeat | Pressing and holding one of its buttons increments or decrements the stepper’s value repeatedly. With dynamic autorepeat, the rate of change depends on how long the user continues pressing the control. TRUE by default. |
manual | It is possible to enter value manually from keyboard or mobile keypad. When click on input field, stepper enter into manual input mode, which allow type value from keyboar and check fractional part with defined accurancy. Click outside or enter Return key, ending manual mode. TRUE by default. |
session | The Shiny session object, usually the default value will suffice. |
While updating, the autorepeat field does not work correctly.
if (interactive()) { library(shiny) library(shinyMobile) shinyApp( ui = f7Page( title = "My app", f7SingleLayout( navbar = f7Navbar(title = "updateF7Stepper"), f7Card( f7Button(inputId = "update", label = "Update stepper"), f7Stepper( inputId = "stepper", label = "My stepper", min = 0, max = 10, size = "small", value = 4, wraps = TRUE, autorepeat = TRUE, rounded = FALSE, raised = FALSE, manual = FALSE ), verbatimTextOutput("test") ) ) ), server = function(input, output, session) { output$test <- renderPrint(input$stepper) observeEvent(input$update, { updateF7Stepper( inputId = "stepper", value = 0.1, step = 0.01, size = "large", min = 0, max = 1, wraps = FALSE, autorepeat = FALSE, rounded = TRUE, raised = TRUE, color = "pink", manual = TRUE, decimalPoint = 2 ) }) } ) }