diff --git a/src/components/button/button.ts b/src/components/button/button.ts index 465094ca..ce6012d8 100644 --- a/src/components/button/button.ts +++ b/src/components/button/button.ts @@ -220,7 +220,7 @@ export default class SlButton extends ShoelaceElement implements ShoelaceFormCon return true; } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { if (this.isButton()) { (this.button as HTMLButtonElement).setCustomValidity(message); diff --git a/src/components/color-picker/color-picker.ts b/src/components/color-picker/color-picker.ts index bac40c9d..4fba75c7 100644 --- a/src/components/color-picker/color-picker.ts +++ b/src/components/color-picker/color-picker.ts @@ -687,7 +687,7 @@ export default class SlColorPicker extends ShoelaceElement implements ShoelaceFo return this.input.reportValidity(); } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { this.input.setCustomValidity(message); this.formControlController.updateValidity(); diff --git a/src/components/input/input.ts b/src/components/input/input.ts index 2f480ffe..55eb12b5 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -373,7 +373,7 @@ export default class SlInput extends ShoelaceElement implements ShoelaceFormCont return this.input.reportValidity(); } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { this.input.setCustomValidity(message); this.formControlController.updateValidity(); diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 6f28d0d8..3198aa49 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -236,7 +236,7 @@ export default class SlRange extends ShoelaceElement implements ShoelaceFormCont return this.input.reportValidity(); } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { this.input.setCustomValidity(message); this.formControlController.updateValidity(); diff --git a/src/components/select/select.ts b/src/components/select/select.ts index 5420667e..9a6780f1 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -608,7 +608,7 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon return this.valueInput.reportValidity(); } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { this.valueInput.setCustomValidity(message); this.formControlController.updateValidity(); diff --git a/src/components/switch/switch.ts b/src/components/switch/switch.ts index 93f59fb6..9a98d1cb 100644 --- a/src/components/switch/switch.ts +++ b/src/components/switch/switch.ts @@ -145,7 +145,7 @@ export default class SlSwitch extends ShoelaceElement implements ShoelaceFormCon return this.input.reportValidity(); } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { this.input.setCustomValidity(message); this.formControlController.updateValidity(); diff --git a/src/components/textarea/textarea.ts b/src/components/textarea/textarea.ts index 8be8d99a..a6c3ce26 100644 --- a/src/components/textarea/textarea.ts +++ b/src/components/textarea/textarea.ts @@ -261,7 +261,7 @@ export default class SlTextarea extends ShoelaceElement implements ShoelaceFormC return this.input.reportValidity(); } - /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ + /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string) { this.input.setCustomValidity(message); this.formControlController.updateValidity();