-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Tooltip: Fix positioning issues that can cause tooltip to flash/not render #16454
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
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 353b25e:
|
Perf AnalysisNo significant results to display. All results
|
Asset size changes
Baseline commit: ae56e24c4fcb61d9d9def1a39d264dfa538b6c12 (build) |
|
🎉 Handy links: |
Pull request checklist
$ yarn changeDescription of changes
Prior to this change there were cases where the tooltip may occlude its targetElement which could cause the tooltip to flash or potentially not appear at all. The issue becomes more prominent if one of more of the follow ins is present:
tooltipGapSpaceis not a whole number of pixels, this is exacerbated the larger the user's devicePixelRatio which can lead to an overlap at the bottom of the targetElement (because the::afterelement is slightly occluding the bottom of the targetElement)To fix these issues I've made two fixes:
OFF_SCREEN_STYLEwhich sets the opacity, but the callout can still occlude the targetElement. I'm adding pointerEvents: none to the styling that is applied in this case so that it will not fire mouse eventstooltipGapSpacecalculation to take into account the user'sdevicePixelRatioand compensate for the sub-pixel roundingFocus areas to test
Verified that there is no functional behavior change outside of the fact that the targetElement is no longer occluded all the way up to 500% browser zoom across IE11, Edge, Chrome, FF, and Safari on Mac