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
Please pass the sourceEvent to onMoveStart, onMove and onMoveEnd #1676
Comments
Hey @Jinhai could you explain what you want to achieve? |
Hi @moklick, thanks for checking. |
Encountered same problem integrating https://headlessui.dev/react/dialog with react flow. The dialog uses an event listener on window to listen for click outside events to close any currently open dialog. Right now opening a dialog then clicking on the canvas does not work since canvas intercepts and stops propagation of the event. As a result, the dialog will stay open. A fix on the dialog library side would be to set capturing=true for the event listener, but I’ve looked at various other dialog libraries such as radix and they also run into the same problem. |
We updated the handlers for v10 and pass the source event: export type OnMove = (event: MouseEvent | TouchEvent, viewport: Viewport) => void;
export type OnMoveStart = OnMove;
export type OnMoveEnd = OnMove; |
Awesome. Thank you! |
d3-drag stops the even propagation at https://github.com/d3/d3-drag/blob/main/src/drag.js#L58
This makes client code cannot get on
mousedown
event.One possible fix is to pass the sourceEvent to onMoveStart, onMove and onMoveEnd, same as other handlers.
The text was updated successfully, but these errors were encountered: