0leg
0leg

Reputation: 14144

Dojo: tooltip delay

Using this code to attache Dojo-tooltips elements:

new Tooltip({
    connectId: 'app-container',
    selector: '*',
    position: ['above-centered', 'after'],
    getContent: function(matchedNode){
        return matchedNode.getAttribute('tooltipText');
    }
});

And then this code to set tooltip text:

<span class="tag" tooltipText="Show tests tagged 'workforce'">Workforce</span>

The problem is that all tooltips have half of a second delay (which looks like a value by default for Dojo), and makes the interface looks laggy. Tried to overwrite it using CSS:

-webkit-animation-duration: 0s !important;
animation-duration: 0s !important;

But this didn't work. Dojo Reference page doesn't have any info as well.

Is there any way to remove this delay?

Upvotes: 2

Views: 284

Answers (1)

Himanshu
Himanshu

Reputation: 1002

The page does have info. The showDelay is by default 400ms. You can change it by passing your own value.

And, there are some problems in your code as far as I can tell. You need to pass the tooltip text in the Tooltip object which you have not done. See the fiddle(link below).

new Tooltip({
    connectId: 'app-container',
    selector: '*',
    showDelay: 0,
    position: ['above-centered', 'after'],
    getContent: function(matchedNode){
        return matchedNode.getAttribute('tooltipText');
    }
});

See this fiddle.

Upvotes: 1

Related Questions