OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

Irrelevant item's value set by setvalue is hidden #111

Open pbowen-oc opened 3 years ago

pbowen-oc commented 3 years ago

Steps:

  1. In the attached form - trigger from set value.xml.txt - select Yes for the first item
  2. Note that the temperature value is set by a set value as expected. Due to a separate issue (#405), the temperature units remain null.
  3. Change the first item to No. Note that the following items become irrelevant but are still displayed due to the non-null temperature value.
  4. If OpenClinica/enketo-express-oc#405 has already been fixed, change temperature units to null.
  5. Edit temperature value to null.

Expected: The value change triggers the set value on the temperature units item and since the group has a non-null value, it remains visible (but still with a relevant error).

I also considered that perhaps the set value on the temperature units might not fire because it is irrelevant, but this does not seem consistent with other behavior.

Actual: The set value on the temperature units item is triggered and sets its value (which is causing a field submission). However, the entire group is immediately hidden before this is observed. If the first question is changed to Yes again, the temperature units item is observed to have the value that was set (due to issue OpenClinica/enketo-express-oc#405, it is clear this is the previously set value, not a newly triggered set value based on the cascade from the Yes selection).

MartijnR commented 3 years ago

http://localhost:8005/single/fs/i/ALuIBDAX?ecid=1

temp_units does have a value after hiding after clearing value for temp

I suspect the asynchronicity of validateInput is the culprit.

MartijnR commented 3 years ago

I don't see a solution for this atm. It's very complex. I think we may have reached the end of what we can do with the relevant error customization.