open-wc / form-participation

Helper, mixins, tools, and more for supporting your custom elements in participating in an ancestor form.
MIT License
53 stars 7 forks source link

Validator attribute required? #47

Open michaelwarren1106 opened 1 year ago

michaelwarren1106 commented 1 year ago

One of my devs got an error today about an attribute property not existing on a validator object.

The error came from this line: https://github.com/open-wc/form-participation/blob/main/packages/form-control/src/FormControlMixin.ts#L39

Which seems to be coded as if the attribute key in the validator object is required, but its typed as optional in the TS typing. IMO it should be optional, so should we do an existence check on the .attribute prop in that map function?

calebdwilliams commented 1 year ago

We should.