I have a textarea that starts with text I don't want the user to be able to change and are prevented in doing so by the following:
- The left key and backspace work until it reaches the position of the undeletable text.
- The up key has a special function and doesn't serve navigational purposes (returns false).
- (With the previous two rules, the user cannot place the caret in this region via arrow keys)
- When the user clicks the element, the caret is placed at the end of the textarea (on mouse down).
- Home and ctrl+a have been handled too.
For illustration's sake, it would look something like
Don't Delete Anything Before the Colon: Your text here. The user text will also
wrap like this.
As far as I know, I have every situation covered but one: Drag and drop. I know how to disable drag and drop entirely, but that isn't what I want. I just don't want the 'undeletable text' to be able to be altered. Can I position the caret before allowing the drop to take place. Alternatively, can I block the drop but access the drop event and place it where I'd like?