-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can cleave()
play nicely with shiny's validate(need(...))
?
#2
Comments
Hi Jon, Thank you very much! I'm afraid that had nothing to do with I just pushed a fix. The issue it correctly removes the "cleave" when a new value is set and hides everything underneath error messages on an error. This should make it a lot more robust! Thanks again for reporting this! Let me know if this does not actually fix it. |
Thanks for the quick response. That does fix the underlying bug (with "old output" remaining visible instead of being hidden when an error state arises) so that's a definite improvement 🎉 However, it doesn't fully address the issue I was raising, which is that ideally I'd like to be able to have Keeping with my example app above, this means that the error message Put another way - when "Blue pill" is selected (on it's own), then I'd expect to see the |
Aaaaah, yes indeed, sorry! I think this time I have it haha. Shiny raises those as "silent errors" javascript-side. I have added an argument to the Let me know if this this what you were after, I would not be surprised I misunderstood again haha |
Excellent! You nailed it 👍 And yes, I think that's a good default - assuming that I'm not alone in having relied heavily on Sorry for not trying to diagnose further or attempt a PR - my javascript ability is too limited at this stage and I had no idea how shiny handled validation errors on the javascript side of things. When raising the issue I did wonder whether maybe I was just wrong to assume these could be used together and should instead just be cleaving all errors (cos that could might be a reasonable approach for some apps), but I do think they are more powerful when used together - allowing for "validating" of expected errors and "cleaving" of unexpected errors. |
Thanks for this really nice package @JohnCoene! Simple, yet powerful & effective.
The below app example behaves as expected if
cleave()
is commented out in the server function, but withcleave()
included, the error "state"A regrettable decision
is never revealed in the #thing output, and instead only the other 2 output "states"Required input is required 😂
andGood choice
are realisable, or both are visible at the same time (when the error state is to be expected).Is it possible to get
cleave()
&validate(need(...))
to work together?Shiny applications not supported in static R Markdown documents
Created on 2020-07-23 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: