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

Closing tooltip on click outside body #728

Open
tdeniau-sticky opened this issue Feb 8, 2018 · 1 comment
Open

Closing tooltip on click outside body #728

tdeniau-sticky opened this issue Feb 8, 2018 · 1 comment

Comments

@tdeniau-sticky
Copy link

Currently only clicks on elements other than the tooltip inside the body are closing it.

I have a page where I display the tooltip at the bottom of the page and instinctively everybody clicks on the bottom, outside the body to close it and nothing happens.

The code responsible for this behavior seems to be the following:

$body.on(eventNames, function(event) {

        if (self._touchIsMeaningfulEvent(event)) {

            self._touchRecordEvent(event);

            if (!self.__options.interactive || !$.contains(self._$tooltip[0], event.target)) {
                self._close(event);
            }
        }
    });

Could you please handle clicks outside document body ?

@louisameline
Copy link
Collaborator

Hi, right, we're using the body element to catch events, using document could do the trick.

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

No branches or pull requests

2 participants