I'm having some very strange behavior with a jQuery UI button. It appears it is happening on chrome only.
I have to click twice to make it work. After further investigation, it seems I had to click outside the text (on the edges of the button), to make it work on first click. I have no elements inside the button - only text.
I am setting the text of the button with jQuery's text() method. When I changed it to html(), it started working as expected.
Although I have found a solution to the issue, I would be very interested in finding out why this happens. Another thing worth mentioning is that I tried to mimic this behavior with jsfiddle, but were unable to.
Code from jsfiddle (stackoverflow requires me to):
Html:
<button>click me</button>
code:
$("button").button().click(function(){
$("body").append("clicked ");
})
.text("click me!");