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

Firefox error when calling d3.pointer inside of 'zoom' event handler #319

Open
Fil opened this issue Aug 30, 2024 · 1 comment
Open

Firefox error when calling d3.pointer inside of 'zoom' event handler #319

Fil opened this issue Aug 30, 2024 · 1 comment

Comments

@Fil
Copy link
Member

Fil commented Aug 30, 2024

Discussed in d3/d3#3907

Originally posted by @tsairinius August 29, 2024
In the following example, I am calling d3.pointer inside of a 'zoom' event handler. The zoom behavior is being applied to an SVG element. When I call the zoom behavior's scaleTo method, the following error occurs in Firefox (Chrome and Edge seem to work fine):

"TypeError: SVGPoint.x setter: Value being assigned is not a finite floating-point value."

I've also tried replacing scaleTo with scaleBy and transform, but the same error pops up.

See example here: https://jsfiddle.net/nLt523mj/

@Fil Fil transferred this issue from d3/d3 Aug 30, 2024
@Fil
Copy link
Member Author

Fil commented Aug 30, 2024

It happens here

point.x = event.clientX, point.y = event.clientY;

the pointer receives an event that has no clientX property, which triggers the error.

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

1 participant