I am developing a virtual keyboard in jQuery and my problem is:
When I press a keyboard key, the input loses focus during a click, and if the number of letters in the input is greater than the size of the input, the beginning of the line is displayed in the input. And then, when the click is released, the input goes back, and the caret approaches the end of the line. So this is pretty ugly, because we get the impression that the contents of the input are blinking.
theButtonDiv.click(function() { attachedInput.value = idOfAttachedInput.value + theActualKey; attachedInput.focus(); });
Therefore, I would like the input to not lose focus when we press a button on the keyboard.
How can i do this?
Thanks.
source share