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

fix: Limit calculation bug when dragging and resizing #397

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

HLN177
Copy link

@HLN177 HLN177 commented Jan 17, 2024

Hi,

Phenomenon: When both left and right mouse buttons are pressed simultaneously to drag or resize, the component becomes "stuck" and can only be restored by refreshing the page.

Cause: When the left mouse button is clicked, it indicates dragging or resizing. If the right mouse button is accidentally pressed at this time, the mousedown event triggers the ”deselect“ function and resets the mouse state in the DOM. This can lead to incorrect internal calculations resulting in NaN.

Solution: Both drag and resize events share a common feature of triggering a mouse click event. A local variable can be created as a "lock." This "lock" is then released after the mouseup event occurs.

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

Successfully merging this pull request may close these issues.

None yet

1 participant