MCPcopy
hub / github.com/autoNumeric/autoNumeric / _setInvalidState

Method _setInvalidState

src/AutoNumeric.js:6147–6156  ·  view source on GitHub ↗

* Set the invalid state on the AutoNumeric element. * If the element is not an input, and therefore a contenteditable-enabled element, its validity state cannot be changed. * In that case, the invalid css class defined with the `settings.invalidClass` option is added to the element. *

()

Source from the content-addressed store, hash-verified

6145 * @private
6146 */
6147 _setInvalidState() {
6148 if (this.isInputElement) {
6149 AutoNumericHelper.setInvalidState(this.domElement);
6150 } else {
6151 this._addCSSClass(this.settings.invalidClass);
6152 }
6153
6154 this._triggerEvent(AutoNumeric.events.invalidValue, this.domElement);
6155 this.validState = false;
6156 }
6157
6158 /**
6159 * Set the valid state on the AutoNumeric element.

Callers 1

Calls 3

_addCSSClassMethod · 0.95
_triggerEventMethod · 0.95
setInvalidStateMethod · 0.80

Tested by

no test coverage detected