Skip to content

Commit

Permalink
regression: fully revert attribute title existence
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot committed Sep 6, 2022
1 parent 6c2c5b9 commit 12e3e60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/src/tooltip.js
Expand Up @@ -509,7 +509,7 @@ class Tooltip extends BaseComponent {
}

this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility
this._element.removeAttribute('title')
this._element.setAttribute('title', '')
}

_enter() {
Expand Down
6 changes: 3 additions & 3 deletions js/tests/unit/tooltip.spec.js
Expand Up @@ -428,15 +428,15 @@ describe('Tooltip', () => {

const tooltipWithTitleEl = fixtureEl.querySelector('#tooltipWithTitle')
const tooltip = new Tooltip('#tooltipWithTitle')
expect(tooltipWithTitleEl.getAttribute('title')).toBeNull()
expect(tooltipWithTitleEl.getAttribute('title')).toBe('')
tooltip.dispose()
expect(tooltipWithTitleEl.getAttribute('title')).toBe('tooltipTitle')

const tooltipWithoutTitleEl = fixtureEl.querySelector('#tooltipWithoutTitle')
const tooltip2 = new Tooltip('#tooltipWithTitle')
expect(tooltipWithoutTitleEl.getAttribute('title')).toBeNull()
tooltip2.dispose()
expect(tooltipWithoutTitleEl.getAttribute('title')).toBeNull()
expect(tooltipWithoutTitleEl.getAttribute('title')).toBeNull('tooltipTitle')
})
})

Expand Down Expand Up @@ -945,7 +945,7 @@ describe('Tooltip', () => {
const tooltip = new Tooltip(tooltipEl)

tooltipEl.addEventListener('shown.bs.tooltip', () => {
expect(tooltipEl.getAttribute('title')).toBeNull()
expect(tooltipEl.getAttribute('title')).toBe('')
resolve()
})
tooltip.show()
Expand Down

0 comments on commit 12e3e60

Please sign in to comment.