MCPcopy
hub / github.com/autoNumeric/autoNumeric / _setValidOrInvalidState

Method _setValidOrInvalidState

src/AutoNumeric.js:6186–6199  ·  view source on GitHub ↗

* Sets the valid or invalid state on the DOM element, if the value is within the range set by the minimum and maximum value * * @param {string} value * @private

(value)

Source from the content-addressed store, hash-verified

6184 * @private
6185 */
6186 _setValidOrInvalidState(value) {
6187 if (this.settings.overrideMinMaxLimits === AutoNumeric.options.overrideMinMaxLimits.invalid) {
6188 const minRangeOk = this.constructor._isMinimumRangeRespected(value, this.settings);
6189 const maxRangeOk = this.constructor._isMaximumRangeRespected(value, this.settings);
6190
6191 if (minRangeOk && maxRangeOk) {
6192 this._setValidState();
6193 } else {
6194 this._setInvalidState();
6195 }
6196
6197 this._triggerRangeEvents(minRangeOk, maxRangeOk);
6198 }
6199 }
6200
6201 /**
6202 * Original settings saved for use when the `decimalPlacesShownOnFocus` and `showOnlyNumbersOnFocus` options are used.

Callers 4

setMethod · 0.95
_onKeypressMethod · 0.95
_onKeyupMethod · 0.95

Calls 5

_setValidStateMethod · 0.95
_setInvalidStateMethod · 0.95
_triggerRangeEventsMethod · 0.95

Tested by

no test coverage detected