Closed kingoflimes230 closed 1 year ago
Hi,
Indeed I can reproduce the issue, but for the moment I didn't find a workaround. There seems to be a strange JavaScript interaction that triggers a modal.bs.show
event when using an input associated to a condition, thus reloading the glide. I'll try to take a look into it again.
Ok, so I think the problem comes from the fact that your my_checkbox
input is not directly in the glide
definition. If you do something like this I think it's working :
advanced_inputs <- function(my_species, my_choiceA) {
if (is.null(my_choiceA)) {
return(0)
}
if (my_choiceA == "Job") {
return(c("Employed", "Self-Employed", "Apprenticeship"))
} else if (my_choiceA == "Mortgage") {
return(c("Apartment", "House"))
} else if (my_choiceA == "Breed") {
return(c("Height", "Fur", "Weight"))
} else if (my_choiceA == "Owner") {
return(c("Age", "Employed", "Children"))
} else {
if (my_species == "Human") {
return(c("Partner", "Parents", "Children", "Siblings"))
} else {
return(c("Owner", "Children", "Owners of Children"))
}
}
}
advanced_inputs_label <- function(my_species, my_choiceA) {
if (is.null(my_choiceA)) {
return(0)
}
if (my_choiceA == "Job") {
return("Type of Jobs")
} else if (my_choiceA == "Mortgage") {
return("Type of Housing")
} else if (my_choiceA == "Breed") {
return("Details")
} else if (my_choiceA == "Owner") {
return("Details")
} else {
return("Details")
}
}
screen(
renderUI({
tagList(
h3("Make Choice B"),
checkboxGroupInput("my_checkbox",
label = advanced_inputs_label(input$rows[2], input$my_pickerinput),
choices = advanced_inputs(input$rows[2], input$my_pickerinput)
)
)
}),
next_condition = "(input['my_checkbox'].length > 0)"
)
Hi,
thanks for looking into it. I finally had time to test it myself, but unfortunately the problem persists for me doing it this way (both in the example as well as my actual app and both in RStudio Browser, Firefox and Google Chrome). If you need further information, please tell me.
I'm sorry for the very late answer, but I think your problem should now be solved with shinyglide development version. If it is not too late and it can still be useful, your original code should work without modification.
Closing the issue, don't hesitate to reopen it if needed.
I posted this on stackoverflow, but have not received any answers, I don't know if it's my coding mistake or an issue with shinyglide (which is a great package, thank you for that!).
I have a
shiny
app in which adatatable
is displayed and upon a click on a row, amodalDialog
opens in which I embedded aglide
. This worked fine until I introduced thenext_condition
to the second screen. Now whenever the first box is selected (or after deselecting everything and selecting again), the glide jumps back to the first screen. If I now change the option on the first screen, then the behaviour gets very strange altogether. My example (with Version 0.1.3.9000):Code:
Library Calls:
UI:
Setup Functions:
Server:
and function call: