Following Example 2 in http://knockoutjs.com/documentation/hasfocus-binding.html
JSFiddle showing problem: http://jsfiddle.net/hXqFu/2/
It works great for both text and checkbox in Firefox, but in Chrome it doesn’t work properly. As soon as I click the checkbox to select or deselect, it seems to lose focus before the check happens.
Any suggestions on how to get this working in Chrome? If I need to, I can just leave it always in “edit” mode, but I’d like to find out if there’s a way to get this working.
Edit:
The problem I’m having is that I’m unable to toggle the checkbox. As soon as I click on it to try to toggle it, the checkbox disappears.
You’re setting the bool too early. This jsfiddle works in chrome:
http://jsfiddle.net/f5PaG/1/
I haven’t altered the textbox code, just the checkbox stuff.
UPDATE: new jsfiddle to show the checkbox while it’s focused: http://jsfiddle.net/hXqFu/3/