juba / shinyglide

Glide.js component for Shiny apps
https://juba.github.io/shinyglide/
91 stars 8 forks source link

gliderControls() missing default arguments #17

Closed JosiahParry closed 3 years ago

JosiahParry commented 3 years ago

In attempting to modify only the lastButton, I am using gliderControls(). The function, however, fails indicating Error in dots_list(...) : argument "next_content" is missing, with no default.

In my server I have the below based on the vignette.

  controls <- glideControls(
    list(
      lastButton(class = "btn btn-success",
                 `data-dismiss` = "modal",
                 "Done")
    ))
JosiahParry commented 3 years ago

Update: specified the argument by name and it forced previous content. Perhaps the function can look like


glideControl <- function(previous_content = prevButton("Back"), next_content = nextButton("Next")) {

...

}
juba commented 3 years ago

Yes, you're right, it's better to have default values in glideControls so that you can redefine only one if needed.

This is fixed in the development version.