Why in this example http://jsfiddle.net/JksKx/8/ div lost cursor when i write text? How to fix such behavior?
Why in this example http://jsfiddle.net/JksKx/8/ div lost cursor when i write text? How to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The keyup event is firing and writing to your viewmodel, which then triggers the update function of the custom binding. This is writing the innerHTML back to the element, which is causing you to lose focus.
An easy fix is to check in the update function if the element.innerHTML already is the same as the value that you want to set it to.
http://jsfiddle.net/rniemeyer/JksKx/9/