Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Popover not showing under certain circumstances #832

Closed
sdesmond opened this issue Aug 16, 2013 · 4 comments
Closed

Popover not showing under certain circumstances #832

sdesmond opened this issue Aug 16, 2013 · 4 comments

Comments

@sdesmond
Copy link
Contributor

The popover is not showing under these circumstances (at least in Chrome, IE10 seems to work):

-The placement is set to 'mouse'.
-The trigger is set to 'mouseenter'.
-You approach the trigger area moving right, or down.

What seems to be happening is that the popover is shown, but as you move right or down, you enter the popover area and mouseout is fired which hides the popover. After it is hidden, 'mouseenter' isn't called again even though the mouse is now once again inside the trigger area.

This doesn't happen when moving left or up since the popover doesn't get in the way of the moving mouse.

http://plnkr.co/edit/JbFOmR6HnSMnBWR4poGO?p=preview

@hallister
Copy link

Hmmm this is an interesting one. It appears that the mousenter is indeed refiring (if you go really slow from the left to the right it does indeed trigger). But if you go quickly the mouseenter is triggering, the popup displays and immediately we get a mouseout because the mouse is in the popover. And mouseenter really wouldn't trigger again if you're already over the button when the popup disappears because your mouse never entered the element (it's just over it, it didn't enter it).

The only way I can think of to fix this would be to bind an mouseenter event to the entire popover that does a e.preventDefault() and an mouseleave that would close the popover. The caveat to this would be if we leave the popover to the button mouseenter still won't fire so the popover won't come back until after we leave the button element and mouse back in. I'll let the others chime in here, maybe a better idea comes up.

@pkozlowski-opensource
Copy link
Member

Grrr, I really think that we shouldn't have added the popover-placement="mouse" option as it is creating corner-cases like this one... @sdesmond what is your functional use-case? Is it very important for you to show this pop-up based on mouse placement?

@sdesmond
Copy link
Contributor Author

I can make it work by using one of the other placements. A fancy solution
here would be to track the mouse (i.e. mousemove event) once the popover is
active and move the popover as the mouse moves so the popover stays at the
same position relative to the mouse as long as it's up. That may be asking
too much, but it's an idea.

On Fri, Aug 16, 2013 at 10:45 AM, Pawel Kozlowski
notifications@gitpro.ttaallkk.topwrote:

Grrr, I really think that we shouldn't have added the
popover-placement="mouse" option as it is creating corner-cases like this
one... @sdesmond https://github.com/sdesmond what is your functional
use-case? Is it very important for you to show this pop-up based on mouse
placement?


Reply to this email directly or view it on GitHubhttps://github.com//issues/832#issuecomment-22778355
.

@hallister
Copy link

I'm with @pkozlowski-opensource on this one. Frankly, mouse popover placement only works if we implemented it via the way @sdesmond suggested, which seems like a lot of work for something to look neat. Personally, I say remove the mouse placement altogether.

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

No branches or pull requests

3 participants