You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been on 3.4.8 for a while, but just upgraded to 3.5.5. My code was checking d3.event.sourceEvent and doing something based on the type, but the sourceEvent is null now when double click is used as opposed to mouse wheel.
// causes Uncaught TypeError: Cannot read property 'type' of null
if (wheelEvent.type === 'wheel' || wheelEvent.type === 'mousewheel') {
The text was updated successfully, but these errors were encountered:
langdonx
changed the title
zoom Behavior
zoom Behavior, dblclick does not provide an event
Apr 30, 2015
Yes. The sourceEvent went away because the double-click now triggers a zoom transition rather than an immediate zoom. (And I don’t believe it makes sense for these delayed events to have a source event, given the source event happened in the past. All other source events occur within the lifecycle of the source event, so that you can, for example, prevent default behaviors.)
You can still listen to dblclick events yourself, optionally with capture, and stop propagation to prevent the zoom behavior from responding to them.
I’m not sure what exactly you’re trying to do, but feel free to reply if you have more questions.
Was removing the event on
dblclick
in the Zoom behavior intentional here?60df296#diff-8a5d2f6d536a2448e970d4de069dc30a
I've been on 3.4.8 for a while, but just upgraded to 3.5.5. My code was checking d3.event.sourceEvent and doing something based on the type, but the sourceEvent is null now when double click is used as opposed to mouse wheel.
The text was updated successfully, but these errors were encountered: