Open johngrabner opened 2 years ago
Just to be clear, it is not a problem w/ the hasFocus
binding - it's merely a suboptimal example. And there are several different approaches to avoid this in a real world situation.
In this particular example, one way would be to change the text
binding on the <b>
element to: text: name() || '[ none ]'
https://knockoutjs.com/documentation/hasfocus-binding.html
click on "Bert Bertington" to gain focus, then clear the entry ie: no text in input field
Now input can never again gain focus.