Skip to content

Commit

Permalink
Extra check for existence of any aria-label
Browse files Browse the repository at this point in the history
before overwriting it...
  • Loading branch information
patrickhlauke authored and XhmikosR committed Nov 30, 2020
1 parent b0372bb commit adc857f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down

0 comments on commit adc857f

Please sign in to comment.