* Replaces current text in the HTML element * depending on element type * @param {string} str * @private
(str)
| 442 | * @private |
| 443 | */ |
| 444 | replaceText(str) { |
| 445 | // let currentElContent = this.getCurrentElContent(this); |
| 446 | |
| 447 | if (this.attr) { |
| 448 | this.el.setAttribute(this.attr, str); |
| 449 | } else { |
| 450 | if (this.isInput) { |
| 451 | this.el.value = str; |
| 452 | } else if (this.contentType === 'html') { |
| 453 | if (this.shouldBackspace) { |
| 454 | this.el.innerHTML = str; |
| 455 | } else { |
| 456 | this.el.innerHTML += str; |
| 457 | } |
| 458 | } else { |
| 459 | this.el.textContent = str; |
| 460 | } |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | /** |
| 465 | * If using input elements, bind focus in order to |
no outgoing calls
no test coverage detected