strong-restaurant-36788
08/15/2022, 5:15 PMrequired: true
to a field changes the UI, but doesn't truly make the field required (in the HTML sense or the server-side validation sense). That true in others experiences?lemon-wall-20836
08/17/2022, 7:42 AMrequired
option is only a cosmetic one. It's mentioned in the docs too.
https://docs.avohq.io/2.0/field-options.html#requiredlemon-wall-20836
08/17/2022, 7:43 AMrequired
option. or at least make it optional.
https://github.com/avo-hq/avo/issues/972strong-restaurant-36788
08/17/2022, 10:24 AMrequired: true
or required: false
), but sometimes you want to require it in a form even if it's not required at the model level, so let's please not lose that. Especially since we have the block form of calculating required.
Moreover, I really think we should require it at the HTML5 level (at the very least) recognizing that for things like Key Value, Trix, Tags, etc. require
different approaches (pun intended).
This isn't sexy work, but I very much think it's worth it.strong-restaurant-36788
08/17/2022, 10:25 AMreadonly
allow a callable -- and readonly does appear to change the markup in most places well. I'm just blocked on writing a decent test for it.
After that, I'll see if I can use that pattern for required
.lemon-wall-20836
08/17/2022, 5:04 PMrequired
to be auto-detectable but overridable from the option.lemon-wall-20836
08/17/2022, 5:05 PMlemon-wall-20836
08/17/2022, 5:05 PMlemon-wall-20836
08/17/2022, 5:12 PMrequired
is callable already
https://github.com/avo-hq/avo/blob/main/lib/avo/fields/concerns/is_required.rblemon-wall-20836
08/17/2022, 5:13 PMreadonly
) and you should be able to do a css query for the disabled
attributelemon-wall-20836
08/17/2022, 5:13 PMstrong-restaurant-36788
08/17/2022, 8:23 PMreadonly