From: Patrick H. Lauke Date: Mon, 9 Nov 2020 22:44:24 +0000 (+0200) Subject: Extra check for existence of any `aria-label` X-Git-Tag: v5.0.0-beta1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adc857f617bfebe05d8f2ec294b1b2e37fac6cd8;p=thirdparty%2Fbootstrap.git Extra check for existence of any `aria-label` before overwriting it... --- diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 936a2a66f2..a04739b7fe 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', '')