diff options
| author | Patrick H. Lauke <[email protected]> | 2020-11-10 00:44:24 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-11-30 12:07:51 +0200 |
| commit | adc857f617bfebe05d8f2ec294b1b2e37fac6cd8 (patch) | |
| tree | 43584116fe409149d9dea12f7ce691873197dbd9 | |
| parent | b0372bb6588ab12c398e5dbf39950dfd3269575e (diff) | |
| download | bootstrap-adc857f617bfebe05d8f2ec294b1b2e37fac6cd8.tar.xz bootstrap-adc857f617bfebe05d8f2ec294b1b2e37fac6cd8.zip | |
Extra check for existence of any `aria-label`
before overwriting it...
| -rw-r--r-- | js/src/tooltip.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 936a2a66f..a04739b7f 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -584,8 +584,8 @@ class Tooltip extends BaseComponent { if (title || originalTitleType !== 'string') { this._element.setAttribute('data-bs-original-title', title || '') - if (!this._element.getAttribute('aria-label') && !this._element.textContent) { - this._element.setAttribute('aria-label', this._element.getAttribute('title') || '') + if (this._element.getAttribute('title') && !this._element.getAttribute('aria-label') && !this._element.textContent) { + this._element.setAttribute('aria-label', this._element.getAttribute('title')) } this._element.setAttribute('title', '') |
