Plugin Button1Up fires when I let go of mouse button 2

Correct: Mouse button 1 up/down fires correctly.
Issue: When holding down Mouse button 2, if I dont move the mouse, then mouse button 2 up is fired after letting go. But immediately afterwards Button 1 down is fired and then button 1 up is fired.
Correct: If I do Mouse button 2 down and move the mouse, when I let go of the mouse button Mouse button 2 up fires and neither Button 1 up/down fire.

This seems to be related to the right click pulldown menu, as when it is toggled, it seems to trigger button 1 up and button 1 down.
video:

empty place with gui for test: Plugin button issue.rbxl (56.1 KB)
lua script to put into plugins folder:
PluginTest.lua (782 Bytes)

Expected behavior

Letting go of mouse button 2 should not fire mouse button 1 up/down

Found someone to take a look, we’ll update you as soon as we can :slight_smile:

Hi @Alkan,

This behavior is due to the ability to select instances in the viewport by right-clicking on them. When you right click and the context menu appears, we fire the MouseButton1 click events to select whatever instance you are hovering over (if any). The context menu is then populated based on the results (allowing you to copy / duplicate / delete / etc).

We believe there may be existing plugins that rely on this behavior to reimplement right-click selection, so I’ll be marking this report as resolved. If you have use cases that cannot be accomplished otherwise, please let me know.

Thanks!