-
Notifications
You must be signed in to change notification settings - Fork 1.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
Respect CSS zoom #5772
Respect CSS zoom #5772
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Looking very good! Thanks for fixing! Integrity fails because of prettier formatting. |
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.
Fantastic fix!
* @param element | ||
*/ | ||
export function calculateZoomLevel(element: Element | null): number { | ||
if (IS_FIREFOX) { |
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.
Should this do feature detection rather than browser detection?
Interesting, I didn't realise they finally implemented it. The bug tracking its implementation is 17 years old: https://bugzilla.mozilla.org/show_bug.cgi?id=390936 |
Css
zoom
property affects the mouse position inevent
s. However, functions likegetBoundingClientRect
do not care about the csszoom
. Hence, the calculations that use mouse positions andgetBoundingClientRect
return wrong values. In this PR those calculations are fixed to return the correct value when csszoom
property is used.Css
zoom
has only been implemented in Nightly version of Firefox. So the fix does not apply to Firefox.In all the examples below the css
zoom
property is set to 2 on the body of the document..Issue with checklist interactions:
Issue with drag handle:
Issue with context menu: