I found what I was doing wrong. My released mouse button was executing for unknown reasons and when I checked it turned out that I was removing the widget from viewport while the mouse was pressed which caused the release mouse button to fire off. Or so what I think right now. Been trying to figure out a fix for the past 4 hours
Note: I had Modal unchecked. doesn’t happen if modal was checked.
Edit: Ya, it’s the problem removing the widget causes the mouse to fire off released event.