Onclicked works differently

its sounds like the widget isnt focused, so the first click sets the focus and the second hits the button.

is your input mode set to UI only?