mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
update form control guidelines
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user