update form control guidelines

This commit is contained in:
Cory LaViska
2023-05-25 10:29:15 -04:00
parent 6144e5eff4
commit dd16b0f65f

View File

@@ -345,12 +345,10 @@ For non-dependencies, _the user_ should decide what gets registered, even if it
### Form Controls
Form controls should support submission and validation through the following conventions:
Form controls should support submission and validation through the following conventions by implementing the `ShoelaceFormControl` interface:
- All form controls must use `name`, `value`, and `disabled` properties in the same manner as `HTMLInputElement`
- All form controls must have a `setCustomValidity()` method so the user can set a custom validation message
- All form controls must have a `reportValidity()` method that report their validity during form submission
- All form controls must have an `invalid` property that reflects their validity
- All form controls must use `name`, `value`, `disabled`, etc. in the same manner as `HTMLInputElement`
- All form controls must implement `checkValidity()`, `reportValidity()`, `setCustomValidity()`, etc. for validation
- All form controls should mirror their native validation attributes such as `required`, `pattern`, `minlength`, `maxlength`, etc. when possible
- All form controls must be tested to work with the standard `<form>` element