Skip to content

Commit

Permalink
tooltiptrigger: don't wait for timeout 0
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Jul 21, 2023
1 parent 7b82325 commit d52d479
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mixins/TooltipTriggerMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ export default function TooltipTriggerMixin(Base) {

/** @param {'mouse'|'touch'|'keyboard'} type */
scheduleShowTooltip(type) {
if (this._tooltipClone.open) {
// console.log('abort schedule (shown)');
return;
}
if (this._tooltipClone.open) return;

let timeout = 0;
switch (type) {
case 'mouse':
Expand All @@ -107,12 +105,14 @@ export default function TooltipTriggerMixin(Base) {
break;
default:
}
// console.log('schedule tooltiptimer');

clearTimeout(this._idleDebounce);
this._idleDebounce = setTimeout(() => {
// console.log('idle');
this.showTooltip(type === 'touch');
}, timeout);
const job = () => this.showTooltip(type === 'touch');
if (timeout) {
this._idleDebounce = setTimeout(job, timeout);
} else {
job();
}
},

showTooltip(touch = false) {
Expand Down

0 comments on commit d52d479

Please sign in to comment.