digestive-functors
digestive-functors copied to clipboard
The disable function does not recursively disable descendant forms
While I was poking around with the disable function to see if I could repurpose it to work with Views in order to address https://github.com/jaspervdj/digestive-functors/issues/63, I learned three things:
- It doesn't work on lists at all
- It only disables fields that are immediate descendants of the form (which explains the previous point)
- Disabling only works if the field is referenced in a specific way
If you have a form that looks like this:
form
subView1 (disabled)
field1
subView2
field2
field3
This template disables field1:
<dfForm>
<dfSubView ref="subView1">
<dfInputText ref="field1" />
</dfSubView>
</dfForm>
This template does not disable field1:
<dfForm>
<dfInputText ref="subView1.field1" />
</dfForm>
The only way to disable field2 and field3 is to also disable subView2. I don't know if this is intended or not, but it's not how I expected it to work.