ml-archive/submissions

"required" attribute not being added

Closed this issue · 2 comments

When I create my text field like so:

makeFieldEntry(keyPath: \.name, label: "Client Name:", validators: [.count(5...)], isOptional: false)

and then call #textgroup("name") the required attribute isn't being added to the input

Sorry for the issue spam. I just see lots of potential to this package!

No issue taken! You're being very helpful and I appreciate all the input and the kind words! It's still early days so it's quite rough around the edges still :)

I was about to add this yesterday but then I realized there is a complication that the field might not have to be required during update. Although on second thought, the input fields are pre-filled anyway so a value should always be present when editing a required field.

The latest commit adds the required attribute depending on the field. Note that I changed the isOptional parameter to isRequired because I think it is a bit clearer and matches the html.