THREE.Interactive icon indicating copy to clipboard operation
THREE.Interactive copied to clipboard

Mouse click event bug?

Open isensen opened this issue 2 years ago • 4 comments

Hello, I have a problem, I have bound the click event to object A. Then I pressed the left mouse button on a blank space but did not release it, then I dragged the mouse to rotate the space (added orbitcontrol), when the mouse is on object A and released the left mouse button, it will activate the click event of A. This caused me to inadvertently activate the event when I just wanted to rotate the space.

isensen avatar Mar 21 '23 08:03 isensen

Hi @isensen, sorry for my late reply. It would be great, if you could provide some sample code, so that I can test that.

markuslerner avatar Apr 08 '23 07:04 markuslerner

Hi @markuslerner , thank you very much for your answer, and sorry for my late reply, in fact the demo provided by the official website has this problem, the click event should be equal to mousedown & mouseup on the same object, otherwise, when I rotate the model randomly in space, it is easy to trigger some click events by mistake. Looking forward to your reply! demo

isensen avatar Apr 20 '23 02:04 isensen

Thank you @isensen, now I know what you mean. One would need to check, if the mousedown event has been detected on that object before the click gets fired. I can implement this as soon as I find the time.

markuslerner avatar May 08 '23 06:05 markuslerner