Skip to content

Commit

Permalink
revert focusIn fix, noop() to noop, correct check
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot committed Jan 6, 2021
1 parent 3910ac0 commit b53f686
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/src/tooltip.js
Expand Up @@ -239,7 +239,7 @@ class Tooltip extends BaseComponent {
throw new Error('Please use show on visible elements')
}

if (!this.isWithContent() || !this._isEnabled) {
if (!(this.isWithContent() && this._isEnabled)) {
return
}

Expand Down Expand Up @@ -467,7 +467,7 @@ class Tooltip extends BaseComponent {
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement) {
[].concat(...document.body.children).forEach(element => {
EventHandler.on(element, 'mouseover', noop())
EventHandler.on(element, 'mouseover', noop)
})
}
}
Expand Down Expand Up @@ -597,7 +597,8 @@ class Tooltip extends BaseComponent {
] = true
}

if (context._hoverState === HOVER_STATE_SHOW) {
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
context._hoverState = HOVER_STATE_SHOW
return
}

Expand Down

0 comments on commit b53f686

Please sign in to comment.