-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: enhance OverflowTooltip
overflow detection for precise handling of non-integral width or height
#806
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
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 a6ef610:
|
Tonic UI Demo
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #806 +/- ##
==========================================
+ Coverage 71.35% 71.40% +0.05%
==========================================
Files 374 374
Lines 6256 6267 +11
==========================================
+ Hits 4464 4475 +11
Misses 1792 1792
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
695b221
to
00a9bc6
Compare
OverflowTooltip
issue in boundary test scenarios
00a9bc6
to
c8681c6
Compare
c8681c6
to
3c9ad7e
Compare
OverflowTooltip
issue in boundary test scenariosOverflowTooltip
component for precise handling of non-integral width or height
OverflowTooltip
component for precise handling of non-integral width or heightOverflowTooltip
overflow detection for precise handling of non-integral width or height
Issue
The column width is set to 180px, and the text is 'V1ES-Workload Security'.
The length of the text (including cell padding of 12px on each side), it exactly matches the 180px width.
This results in scrollWidth === clientWidth (no OverflowTooltip displayed), but the style is truncated.
Env
MacOS Ventura 13.6
Chrome 119.0.6045.123
Solution
Using getBoundingClientRect / getClientRects to obtain width with fractional precision instead of scrollWidth
CodeSandbox: https://codesandbox.io/s/overflowtooltip-issue-7vjsls?file=/src/CustomOverflowTooltip/CustomOverflowTooltip.js