-
Notifications
You must be signed in to change notification settings - Fork 75
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
define reactive cascade order #1346
Comments
|
Thank you @wch ! I just noticed. However I'm still missing something. When the A drop-down changes and triggers an update on the B drop-down items (via |
I'm having a bit difficulty picturing the whole problem. Can you create a minimal reproducible example and share with a shinylive.io link? |
Sorry you're right. I was just about to do that but I figured out what the problem was. C's |
I have a UI that has 3 components (dropdowns), A, B, C that can each change independently but the values of B are based on A and the values of C are based on B (all of which is defined in a table; see example below). Right now, I have 2 separate
@reactive.effect
-decorated functions (but without a@reactive.event
restriction) that update the options in B when something changes and the options in C when something changes. My issue is that sometimes C updates before B when A changes because there's no strict rule stating otherwise. How do I solve this issue?If I attached a
@reactive.event
on A to change the options in B and a@reactive.event
on B to change the options in C, then a change in A that happens to have an identical B option will not trigger an update on C. For example consider the following minimal table:If A has "one" selected and I switch it to "two" I would like C to give "bar" as the only option. This is only possible if C can update either when B changes or A changes but there's no rule stating that B should update before C does.
If I have no
@reactive.event
restrictions then sometimes C updates before B and I get an erroneous lookup for, e.g.A == "two" and B == 0 and C =="bar"
How do I force reactive order to be A --> B --> C? Hope this makes some sense.
The text was updated successfully, but these errors were encountered: