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

mouseup events captured on document must not stopPropagation() if dragging or resizing is not active #54

Open
herrgrossmann opened this issue Mar 3, 2023 · 0 comments

Comments

@herrgrossmann
Copy link

I have a problem with captured / stopped mouseup events when using the FlexibleModal in combination with react-switch. When clicking the switch, the mouseup event will be captured by the listener registered in componentDidMount on document.

The following change fixes the problem:

onMouseUp(e: { stopPropagation: () => void; }) { document.removeEventListener('mousemove', this.onMouseMove); if (this.state.isDragging || this.state.isResizing){ this.setState({ isDragging: false }); this.setState({ isResizing: false }); e.stopPropagation(); // e.preventDefault(); } }

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

No branches or pull requests

1 participant