resolveUsing callback is executed every time the dependsOn callback is triggered and results in non-reactive behavior for the BooleanGroup field (and possibly other fields) #4336
Replies: 9 comments
-
Please be specific with what you mean about "they never get updated"? Update Description and Detail reproducing steps instead of just referring to another issue. |
Beta Was this translation helpful? Give feedback.
-
@crynobone I dug a bit deeper and found that the options that are correctly changed and reactive when set within the dependsOn callback if the original reproduction example (#4294) is used. However, if you add a resolveUsing callback to the mix, the reactivity is gone, no matter what you do in the resolveUsing callback. I updated the issue title and description with a reproduction example which replicates the problem. It seems like the resolveUsing callback is called every time the dependsOn callback is triggered. I don't know if that's to be expected (to me it sounds like resolveUsing should only be used on page/form load), but even if it is, it seems to break the options reactivity. |
Beta Was this translation helpful? Give feedback.
-
|
I would need to see a full reproducing repository for this. Please submit one similar to https://github.com/nova-issues |
Beta Was this translation helpful? Give feedback.
-
@crynobone Alright, I will try to spin one up because the original one is a private unreleased project. I'll let you know. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Also you need to resolve the field before applying depends on logic. This feel like change of behavior now rather than a simple bugfix. |
Beta Was this translation helpful? Give feedback.
-
|
@crynobone Not sure I understand. Do you mean that it would require a lot of work on your end or that there's something I did wrong in my reproduction code? If so, can you explain please? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
The current behaviour now is that you always It would be best to duplicate the resolveUsing code in dependsOn. |
Beta Was this translation helpful? Give feedback.
-
|
@crynobone Alright, I'll try to dabble with it tomorrow, but meanwhile, here's the reproduction repo (if you wanna take a peek or try it out on your end). |
Beta Was this translation helpful? Give feedback.
-
|
@crynobone Alright, so I dabbled with it and found a workaround (see my second latest commit). That being said, I still believe there's a bug with how If you log what the The following is somewhat unrelatedAnother unrelated issue that I found when debugging (I don't know if it is expected), is that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
If a BooleanGroup field depends on another field and you have a resolveUsing callback that is set, the resolveUsing callback is called every time the dependsOn callback is triggered and it seems to break the dependsOn behavior (new options that are set within the dependsOn callback are not rendered).
Detailed steps to reproduce the issue on a fresh Nova installation:
Additional information:
Original issue: #4294
Beta Was this translation helpful? Give feedback.
All reactions