From: XhmikosR Date: Sun, 29 Mar 2020 06:53:57 +0000 (+0300) Subject: Use `textContent` instead of `innerText`. (#30462) X-Git-Tag: v5.0.0-alpha1~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed94976ea80cfe5fa2bd9b6a6913c78de8626045;p=thirdparty%2Fbootstrap.git Use `textContent` instead of `innerText`. (#30462) It's supported by all of our supported browsers. --- diff --git a/.eslintrc.json b/.eslintrc.json index 7ccce3214c..8c52318b47 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -48,7 +48,6 @@ "unicorn/prefer-number-properties": "off", "unicorn/prefer-query-selector": "off", "unicorn/prefer-set-has": "off", - "unicorn/prefer-text-content": "off", "unicorn/prevent-abbreviations": "off" } } diff --git a/js/src/tooltip.js b/js/src/tooltip.js index c493b15eeb..9a1dff3d6e 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -421,7 +421,7 @@ class Tooltip { element.appendChild(content) } } else { - element.innerText = content.textContent + element.textContent = content.textContent } return @@ -434,7 +434,7 @@ class Tooltip { element.innerHTML = content } else { - element.innerText = content + element.textContent = content } } diff --git a/js/tests/unit/tooltip.spec.js b/js/tests/unit/tooltip.spec.js index ed89315e0b..5e3bb93261 100644 --- a/js/tests/unit/tooltip.spec.js +++ b/js/tests/unit/tooltip.spec.js @@ -913,7 +913,7 @@ describe('Tooltip', () => { tooltip.setElementContent(tooltip.getTipElement(), 'test') - expect(tooltip.getTipElement().innerText).toEqual('test') + expect(tooltip.getTipElement().textContent).toEqual('test') }) })