Skip to content
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

d3.mouse doesn’t observe CSS transform on Firefox. #81

Closed
mbostock opened this issue Jul 13, 2016 · 5 comments
Closed

d3.mouse doesn’t observe CSS transform on Firefox. #81

mbostock opened this issue Jul 13, 2016 · 5 comments

Comments

@mbostock
Copy link
Member

Test case here:

http://bl.ocks.org/mwdchang/raw/a88aa3f61f5a2243d15bb8a264aa432e/

This appears to be a known bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=972041

The problem is that rect.getScreenCTM returns the same matrix independent of any transforms applied to ancestor elements, so it ignores the transform applied to div2. The correct transform is {a: 1, b: 0, c: 0, d: 1, e: 110, f: 152}, the wrong transform is {a: 1, b: 0, c: 0, d: 1, e: 10, f: 52} which is approximately what Firefox returns (f = 53.20000076293945 for some reason…).

I’m not planning on implementing a workaround for this bug, so I’m going to close this issue, but I wanted to document the bug for future reference.

@GopherJ
Copy link

GopherJ commented Aug 23, 2018

Hello, @mbostock

Do you have a plan for fixing this? I'am working on a dashboard system using d3.js and VueJs. I noticed that in firefox, d3.mouse function has added the transform3d attribute value of ancestor.

@StuntStar
Copy link

Hello, @mbostock ,

Any workaround for this, looks like in firefox d3.brush does not draw overlay rect properly, if svg container is transformed or translated.

Any help will be appreciated.

@mahish
Copy link

mahish commented Oct 30, 2018

Please, go to the mentioned bugzilla page (https://bugzilla.mozilla.org/show_bug.cgi?id=972041) and vote for this annoying bug to be fixed (find the option under Details tab).
image

@mbostock mbostock mentioned this issue Mar 20, 2019
9 tasks
@mahish
Copy link

mahish commented Jul 31, 2019

The bug was fixed in Firefox 68. However, the issue is still there for me:( Anyone else?

@mahish
Copy link

mahish commented Sep 5, 2019

Workaround which works in my case as hinted in #191:

if (firefox) {
  // this works in Firefox
  position = [
    d3.event.offsetX,
    d3.event.offsetY,
  ];
} else {
  // this works in Chrome
  position = d3.mouse(container);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants