surveydown-dev / surveydown

Markdown-Based Surveys Using R, Quarto, and Shiny
https://pkg.surveydown.org/
Other
65 stars 10 forks source link

Potential problem with reactivity #80

Closed chris-gaskell closed 2 months ago

chris-gaskell commented 2 months ago

Amazing project. Well done to all involved.

First time using issues on GitHub so please excuse my probable lack of competence or any accidental ignorance of convention.

I'm having a problem trying to make reports based on user inputs, so heavily dependent upon reactivity. When I have two reactive inputs it seems to display the more recent response twice.

Screenshot 2024-08-29 at 16 54 03
jhelvy commented 2 months ago

Thanks! Can you post the code for the qmd file that you used to make this? It will help us figure out the source of the issue.

And thanks for trying it out, this is what we need to make it better. We need users to try it and see what issues there might still be.

jhelvy commented 2 months ago

Also, I do think this is a bug, and I think I know the source of it. I'm traveling today but I'll see if I can grab a moment to address it.

chris-gaskell commented 2 months ago

Thanks for the prompt response.

Of course, is this repo ok? https://github.com/chris-gaskell/survey-reactivity-mwe

pingfan-hu commented 2 months ago

Hi @chris-gaskell, the sd_display_value() function is now fixed. I've tested with your repo and it went through.

Please install our package using: remotes::install_github("surveydown-dev/surveydown", force = TRUE). Then test if the function works out fine on your end.

Any further questions please let us know!

Further explanation if you are interested: It's not the problem with the sd_display_value() function, but rather how we collect user inputs in our server file. It used to collect only the last user input (and even though we save all user inputs as a list, it will be a duplication of the last input).

chris-gaskell commented 2 months ago

@pingfan-hu thanks for the quick response and solution!

I have just tried it on my system and it works perfectly now 😄. Thanks so much! And thanks also for the helpful explanation behind the error.

Looking forward to surveydown in my projects. Needless to say I am likely to return with more questions.

bw, Chris

pingfan-hu commented 2 months ago

Glad it's working! 🎉 I'll close this issue since it's solved.