* Handler for the 'focusin' event. * This is called before the 'focus' event, and is necessary to change the selection on focus under Firefox for instance. * * @param {Event} e * @private
(e)
| 6430 | * @private |
| 6431 | */ |
| 6432 | _onFocusIn(e) { |
| 6433 | if (this.settings.selectOnFocus) { |
| 6434 | // The whole input content is selected on focus (following the `selectOnFocus` and `selectNumberOnly` options) |
| 6435 | //XXX Firefox <47 does not respect this selection...Oh well. |
| 6436 | this.select(); |
| 6437 | } else { |
| 6438 | // Or we decide where to put the caret using the `caretPositionOnFocus` option |
| 6439 | if (!AutoNumericHelper.isNull(this.settings.caretPositionOnFocus)) { |
| 6440 | AutoNumericHelper.setElementSelection(e.target, this._initialCaretPosition(AutoNumericHelper.getElementValue(this.domElement))); |
| 6441 | } |
| 6442 | } |
| 6443 | } |
| 6444 | |
| 6445 | /** |
| 6446 | * Enter the special 'formula mode' where users can enter a math expression that will be evaluated on blur and `enter` |
no test coverage detected