-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(tooltip): always append to body and disappear on scroll #6140
Conversation
- Default animation origin has been set to bottom that mean the origin is `top center`
ngWindow.on('blur', windowBlurHandler); | ||
ngWindow.on('resize', debouncedOnResize); | ||
document.addEventListener('scroll', windowScrollHandler, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this on Firefox? Scrolling behavior is slightly different there.
I still suspect that something is doing stopProagation
on the scroll event...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably causing the bug on firefox (at least in 1.09) where tooltips flash and immediately get removed...
http://www.quirksmode.org/dom/events/scroll.html Try listening on window? |
Hacked together a workaround: |
Workaround seems like it would be good. @EladBezalel are you going to apply it and add a unit test? |
An explanation for the workaround (which should probably be added in a comment): It seems like appending and/or repositioning the menu was triggering the scroll events (In FF only, which seems like buggy behavior but we're stuck with it). These events happen more or less right away, so nextTick fires after them. |
This is not working entirely, when checking the checkbox it's still disappearing. |
Well, it's another step towards hacky, but a timeout of 100ms instead of nextTick does the trick for the checkbox. Perhaps there's a longer animation going on when it triggers from the checkbox? |
What do you mean by checking the checkbox? |
Better solution: remove transform: translate3d(0,0,0); from tooltip.scss. That seems to be the source of our FF misbehavior. |
@kseamon that sounds like the best |
@jelbourn I'm on it |
I have not dived in with the chrome tools to look at paint performance to see if this makes any difference, but adding "will-change: opacity, height, width;" does not trigger the misbehavior but probably replaces any performance gains that the transform was accomplishing. |
top center
@jelbourn please review