* Set the invalid state for the given element. * A custom message can be passed as the second argument. * Note: This does not work with contenteditable elements * * @param {HTMLElement|HTMLInputElement} element * @param {string|null} [message='Invalid'] Custom message (optio
(element, message = 'Invalid')
| 1293 | * @throws Error |
| 1294 | */ |
| 1295 | static setInvalidState(element, message = 'Invalid') { |
| 1296 | if (message === '' || this.isNull(message)) this.throwError('Cannot set the invalid state with an empty message.'); |
| 1297 | |
| 1298 | element.setCustomValidity(message); |
| 1299 | } |
| 1300 | |
| 1301 | /** |
| 1302 | * Set the valid state for the given element. |
no test coverage detected