* Listen for the `alt` key keydown event globally, and if the event is caught, unformat the AutoNumeric element that is hovered by the mouse. * * @param {KeyboardEvent} e * @private
(e)
| 7811 | * @private |
| 7812 | */ |
| 7813 | _onKeydownGlobal(e) { |
| 7814 | //TODO Find a way to keep the caret position between the alt keyup/keydown states |
| 7815 | if (AutoNumericHelper.character(e) === AutoNumericEnum.keyName.Alt) { |
| 7816 | const hoveredElement = AutoNumericHelper.getHoveredElement(); |
| 7817 | if (AutoNumeric.isManagedByAutoNumeric(hoveredElement)) { |
| 7818 | const anElement = AutoNumeric.getAutoNumericElement(hoveredElement); |
| 7819 | if (!anElement.formulaMode && anElement.settings.unformatOnHover) { |
| 7820 | this.constructor._unformatAltHovered(anElement); |
| 7821 | } |
| 7822 | } |
| 7823 | } |
| 7824 | } |
| 7825 | |
| 7826 | /** |
| 7827 | * Listen for the `alt` key keyup event globally, and if the event is caught, reformat the AutoNumeric element that is hovered by the mouse. |
no test coverage detected