Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in example hasfocus-binding.html #2581

Open
johngrabner opened this issue Oct 26, 2021 · 1 comment
Open

bug in example hasfocus-binding.html #2581

johngrabner opened this issue Oct 26, 2021 · 1 comment

Comments

@johngrabner
Copy link

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.

@fastfasterfastest
Copy link

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 ]'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants