-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
fix(tooltip): remove redundant scroll offset #4958
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #4958 +/- ##
===========================================
+ Coverage 76.45% 79.32% +2.86%
===========================================
Files 164 164
Lines 13842 13842
Branches 693 693
===========================================
+ Hits 10583 10980 +397
+ Misses 3105 2713 -392
+ Partials 154 149 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Love to see a magic number disappear.
window.scrollY is already account for which means document.body.scrollTop incorrectly offsets the tooltip vertically. The same is not true for horizontal position.
Position the tooltip centered, just below the node being hovered. Update packages/mermaid/src/diagrams/flowchart/flowDb.js Co-authored-by: Sidharth Vinod <[email protected]>
@sidharthv96 I have no idea why the linting job failed. Doesn't seem to complain over actual linting but something with the setup. |
* develop: (21 commits) Fix typo fix typo Add new Atlassian integrations chore(deps): update all patch dependencies chore: release v10.6.1 fix(flow): fix invalid ellipseText regex review fixes Update XYChart's nav link in the docs template Update index.md add comment for ts ignore move decodeEntities to utils review fixes chore(deps): update all minor dependencies chore: Point to correct changelog add spec fix: getMessageAPI so it considers entity codes Update classDiagram.md Chore: Typo fixed in multiple files feat(gantt): update styles docs(integrations): add Mermaid for Slack ...
The lint was failing because there was an unnecessary space in the changes. I've fixed it. |
@csholmq, Thank you for the contribution! |
📑 Summary
window.scrollY is already account for which means document.body.scrollTop incorrectly offsets the tooltip vertically.
The same is not true for horizontal position.
📏 Design Decisions
Removing one of the scroll offsets should set things straight. Not tested as I don't know how to.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch