This is how it should be - mouse actions trigger on releasing the button, not when pushing it. It allows the user to correct a mistake if they accidentally pressed the button, because they can move the mouse away from the clicked object and the action will not trigger. Many modern self-cooked UI systems seem to forget about this, it's just sad.