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

Window resize do not reveals tooltip which was hidden by scroll #633

Open
KazimirPodolski opened this issue Dec 5, 2016 · 9 comments
Open
Labels

Comments

@KazimirPodolski
Copy link

KazimirPodolski commented Dec 5, 2016

Tooltip's origin was hidden by scrolling the page, so the tooltip is hidden too with "visibility": "hidden" (by __scrollHandler I guess). When browser window was expanded, the origin became visible, but tooltip is not.

I guess window resize callback does not change "visibility" (and none but scroll callback does). Is there a
reason or is it a bug? Recomputing overflow and setting visibility on resize fixed this for me, should I test some cases?

@KazimirPodolski KazimirPodolski changed the title Resize do not reveals tooltip hidden by scroll Resize do not reveals tooltip which was hidden by scroll Dec 5, 2016
@KazimirPodolski KazimirPodolski changed the title Resize do not reveals tooltip which was hidden by scroll Window resize do not reveals tooltip which was hidden by scroll Dec 5, 2016
@louisameline
Copy link
Collaborator

Hello, thanks for the report, this is indeed an edge case I had not thought of.

@speckis
Copy link

speckis commented May 5, 2017

@louisameline Just checking in to see if there is any progress on this bug?

@spontaliku-softaria Also, would be nice if you explained how you fixed this for yourself?

@KazimirPodolski
Copy link
Author

KazimirPodolski commented May 5, 2017

@speckis Here is my changes of tooltipster.bundle.js:

  1. In function __scrollHandler there is a code which sets overflows variable. Extract the code to separate function (I called it __overflows) which returns boolean.
  2. In function _open there is code after comment // reposition on resize (inside .on). Change it this way:
if (	(!$ae.is('input') && !$ae.is('textarea'))
	||	!$.contains(self._$tooltip[0], $ae[0])
) {
	self._$tooltip.css('visibility', self.__overflows() ? 'hidden' : 'visible');
	self.reposition(e);
}

@louisameline
Copy link
Collaborator

louisameline commented May 5, 2017

I haven't really had the time as it did not seem a priority. The solution will look like @spontaliku-softaria's in the sense that I'll need to isolate the "overflows" things too, but maybe just create a dedicated resize listener and not edit the _open method.

@speckis
Copy link

speckis commented May 5, 2017

@spontaliku-softaria Thanks for the reply and help! I've noticed, it works as intended but I realized I had a different kind of bug. Bascially, when I open the tooltip from the startpoint without scrolling, it opens fine. But when I scroll down a bit and click, it opens with set height for example "44px" (should be a lot higher).

Before I implemented your fix, when I scrolled; the rest of the tooltip was revealed. Now the scroll doesn't change anything, and it stays on that low height. But thanks anyway! :)

@KazimirPodolski
Copy link
Author

@speckis The fix shouldn't broke height - I don't see how it is related. I guess you will need to debug it yourself 😞

@speckis
Copy link

speckis commented May 5, 2017

@spontaliku-softaria No, the height was already broken, but as soon as I scrolled, it filled out. That's why I thought I had a similiar problem to yours, and that your solution would fix it. But it's clearly something else. :/

@louisameline
Copy link
Collaborator

@speckis you can open a new issue if you want, mentioning the options and the browser you use. Ideally with a jsFiddle test case or at least a screenshot. Thanks

@speckis
Copy link

speckis commented May 5, 2017

@spontaliku-softaria @louisameline Okay, it was clearly a css-issue... (for some reason I made the tooltipster-base "display: flex" some time ago). Thanks anyway!

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

No branches or pull requests

3 participants