The text cursor position is not preserved on the wrong symbol input
Issue description
The text cursor position is not preserved on the wrong symbol input.
Steps to reproduce the issue
- Write a text in the input field
- Move the cursor inside the string
- Type the wrong symbol
What's the expected result?
- The new symbol is not appearing, the cursor keeps its place
What's the actual result?
- The new symbol is not appearing, the cursor jumps to the end of the string
Additional details / screenshot
- Possibly, the issue is in the wrong event listener. You may try to add an event handler to keypress event of the input field as described here: http://www.javascripter.net/faq/keyboardinputfiltering.htm (Example 2)