Our blazing fast Grid component built with pure JavaScript


Post by henrikbackman »

Hi,

When initializing a tooltip I can set hoverDelay (https://bryntum.com/docs/scheduler/#Com ... hoverDelay), but that only seems to work on the first event. Consecutive events ignore the delay and displays the tooltip immediately instead of waiting. Looking through your docs I can't find any information about how to make sure the delay is "triggered" on every hover.

Is there a smart way of doing this?

Thanks.

Post by henrikbackman »

Hi,

Thats not really what I was after. The issue I'm having is that once the tooltip is displayed there is no delay when I move the cursor to the next element. The tooltip for that element is displayed immediately and not after the set delay time as I expect.

Post by pmiklashevich »

I see what you mean. It's shown in CellTooltip demo. While you hover through the cells tooltip is not getting hidden, it's getting realigned and updated. That's by design. I've created a feature request to make this behavior configurable:
https://app.assembla.com/spaces/bryntum/tickets/7051

Here is a quick Tooltip.handleForElementOver override that might help you out:
handleForElementOver(event, newTarget) {
        const me = this;

        me.pointerEvent = event;
        me.abortDelayedHide();

        // We are over a new target. If we are still visible, we
        // do not want to hide to avoid flickering. But if there is a
        // beforeshow listener which may mutate us, we still have to
        // consult it. If it returns a veto, then we do in fact hide.
        // Under normal circumstances we just alignTo the new target.
        // We must handle the post show tasks like starting the dismiss timer etc.
        if (me.isVisible && !me.dontStayVisibleWhenChangingTargets) {
            if (me.trigger('beforeShow') === false) {
                return me.hide();
            }
            me.updateActiveTarget(newTarget);
            me.alignTo({
                target  : me.anchorToTarget ? newTarget : new Point(me.pointerEvent.pageX - window.pageXOffset + me.mouseOffsetX, me.pointerEvent.pageY - window.pageYOffset + me.mouseOffsetY),
                overlap : !(me.anchorToTarget && me.anchor)
            });
            me.trigger('show');
            me.afterShowByTarget();
        }
        else {
            if (me.dontStayVisibleWhenChangingTargets) {
                me.hide();
            }
            me.updateActiveTarget(newTarget);
            me.delayShow(newTarget);
        }
    }

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply