Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.activeToolTip.stop is not a function #401

Closed
sampottinger opened this issue Oct 5, 2023 · 2 comments
Closed

this.activeToolTip.stop is not a function #401

sampottinger opened this issue Oct 5, 2023 · 2 comments

Comments

@sampottinger
Copy link

sampottinger commented Oct 5, 2023

Describe the bug
With tooltip enabled, I sometimes get this.activeToolTip.stop is not a function when having my mouse leave a region but it seems to be stochastic. The tooltip will remain visible and no additional tooltips will be made until refresh.

To Reproduce
Here is an initialization of imagemapster:

function setupImageMaps(tooltipInfo, side) {
    const options = {
        render_highlight: {
            fillColor: "FFFFFF",
            fillOpacity: 0,
            strokeWidth: 2,
            strokeColor: "000000",
            stroke: true,
        },
        enableAutoResizeSupport: true,
        autoResize: true,
        clickNavigate: true,
        showToolTip: true,
        mapKey: "name",
        listKey: "name",
        areas: makeForSide(tooltipInfo, side)
    };
    $("#" + side + "-image").mapster(options);
}


function makeForSide(target, side) {
    return target.map((x) => {
        return {
            "key": side + x["key"],
            "toolTip": x["toolTip"]
        };
    });
}

Expected behavior
When mouse-out over a region, the tooltip should close.

Desktop (please complete the following information):
Tried on both desktop and mobile with same behavior

  • OS: Linux
  • Browser: Firefox
  • Version: 110

Smartphone (please complete the following information):

  • Device: iPad Pro
  • OS: iPadOS 17
  • Browser: Stock Safari

Additional context
I can work around this problem with the following modification (I added the very inelegant try catch):

    m.MapData.prototype.clearToolTip = function() {
        if (this.activeToolTip) {
            try {
                this.activeToolTip.stop().remove();
            } catch {
                this.activeToolTip.remove();
            }
            this.activeToolTip = null;
            this.activeToolTipID = null;
            u.ifFunction(this.options.onHideToolTip, this);
        }
    };
@techfg
Copy link
Collaborator

techfg commented Mar 13, 2024

Hello @sampottinger -

Sorry to hear your encountering an issue with the tooltips. Unfortunately, your bug report does not provide enough information to reproduce the issue. Please provide a full repro of the issue using jsfiddle (or similar) so that we can investigate further.

Thank you!

@techfg
Copy link
Collaborator

techfg commented May 1, 2024

Hello @sampottinger -

I'm going to go ahead and close this issue since we haven't heard back from you regarding providing a repro so that we can investigate your issue. If this remains an issue for you, please open a new issue with a full repro and we'd be happy to take a look.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants