* Check if the DOM element is supported by autoNumeric. * A supported element is either an element with the correct 'type' attribute, or a tag whitelisted in the `allowedTagList` array. * If the check fails, this method throws. * This function also sets the info `this.isInputE
()
| 7927 | * @private |
| 7928 | */ |
| 7929 | _checkElement() { |
| 7930 | const currentElementTag = this.domElement.tagName.toLowerCase(); |
| 7931 | |
| 7932 | if (!this._isElementTagSupported()) { |
| 7933 | AutoNumericHelper.throwError(`The <${currentElementTag}> tag is not supported by autoNumeric`); |
| 7934 | } |
| 7935 | |
| 7936 | if (this._isInputElement()) { |
| 7937 | if (!this._isInputTypeSupported()) { |
| 7938 | AutoNumericHelper.throwError(`The input type "${this.domElement.type}" is not supported by autoNumeric`); |
| 7939 | } |
| 7940 | |
| 7941 | this.isInputElement = true; |
| 7942 | } else { |
| 7943 | this.isInputElement = false; |
| 7944 | this.isContentEditable = this._isContentEditable(this.domElement); |
| 7945 | } |
| 7946 | } |
| 7947 | |
| 7948 | /** |
| 7949 | * Returns `true` if the given DOM element is a contenteditable one (set to `true`) |
no test coverage detected