From dd16b0f65fded9448837bf2ae1fcb98aab84e70e Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 25 May 2023 10:29:15 -0400 Subject: [PATCH] update form control guidelines --- docs/resources/contributing.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/resources/contributing.md b/docs/resources/contributing.md index 46ae689f2..f7e0f7d72 100644 --- a/docs/resources/contributing.md +++ b/docs/resources/contributing.md @@ -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 `
` element