* Set the given value on the DOM element, and the raw value on `this.rawValue`, if both are given. * If only one value is given, then both the DOM element value and the raw value are set with that value. * The third argument `saveChangeToHistory` defines if the change should be recorded in
(newElementValue, rawValue = null, saveChangeToHistory = true)
| 2330 | * @private |
| 2331 | */ |
| 2332 | _setElementAndRawValue(newElementValue, rawValue = null, saveChangeToHistory = true) { |
| 2333 | if (AutoNumericHelper.isNull(rawValue)) { |
| 2334 | rawValue = newElementValue; |
| 2335 | } else if (AutoNumericHelper.isBoolean(rawValue)) { |
| 2336 | saveChangeToHistory = rawValue; |
| 2337 | rawValue = newElementValue; |
| 2338 | } |
| 2339 | |
| 2340 | //XXX The order here is important ; the value should first be set on the element, then and only then we should update the raw value |
| 2341 | // In the `set()` function, we make sure to call `_setRawValue` *after* `setElementValue` so that if `_setRawValue` calls a callback that modify the `rawValue`, then the new value is set correctly (after `setElementValue` briefly set its value first) |
| 2342 | this._setElementValue(newElementValue); |
| 2343 | this._setRawValue(rawValue, saveChangeToHistory); |
| 2344 | |
| 2345 | return this; |
| 2346 | } |
| 2347 | |
| 2348 | /** |
| 2349 | * Return the multiplied raw value with the `rawValueDivisor`. |
no test coverage detected