File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/uui-base/lib/mixins Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,20 @@ export const FormControlMixin = <T extends Constructor<LitElement>>(
209
209
this . _formCtrlElements . push ( element ) ;
210
210
}
211
211
212
+ /**
213
+ * @method setCustomValidity
214
+ * @description Set custom validity state, set to empty string to remove the custom message.
215
+ * @param message {string} - The message to be shown
216
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity|HTMLObjectElement:setCustomValidity }
217
+ */
218
+ protected setCustomValidity ( message : string ) {
219
+ this . _internals . setValidity (
220
+ 'customError' ,
221
+ message ,
222
+ this . getFormElement ( )
223
+ ) ;
224
+ }
225
+
212
226
private _runValidators ( ) {
213
227
this . _validityState = { } ;
214
228
You can’t perform that action at this time.
0 commit comments