Skip to content

Conversation

@lihuaabcder
Copy link

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.

1 participant