Disable move of cursor during auto-complete selection
<p>I need to disable the movement of the cursor during auto-complete selection. I have a contentEditable div as the search bar for friends. when I type any letters an auto-complete suggestions appear underneath the search bar. During a selection of the auto-complete suggestions, I need to use the arrow keys to select. But this will also move the cursor on the search bar and it will also disable any current selection in the search bar. Can I somehow disable the movement of cursor for some specific buttons/keys on the keyboard in javascript?</p>

<p>Note: </p>

<ul>
<li>Setting the cursor at the last position is not a solution for me.</li>
<li>I want to disable left-, right-, up-, down arrow key and also carriage return key</li>
</ul>
