emojionearea
emojionearea copied to clipboard
Wrong initial cursor position in Firefox
Im using the plugin to send messages with a textarea. Pressing enter the message is sent and the editor is cleaned. My problem is that it always generates some "br" tags and I don't know how to remove them or how to put the cursor in the initial position .
Please create example at jsfiddle https://jsfiddle.net/mervick/1v03Lqnu/765/
https://jsfiddle.net/ovj6dy1n/ This is the link.Please note that when you type something and press enter the cursor goes down one line. I think if you press enter without having previously pressed the shift key, the cursor remains on the same line.
event.preventDefault();
fixes this behavior
https://jsfiddle.net/mervick/b8oju234/1/
That worked!!The other thing I found is that if you remove the placeholder option the initial cursor position is outside the text box
Please create an example at jsfiddle
Here is the link. https://jsfiddle.net/e408uqgv/. When the text box is clicked the initial cursor position is outside it
It's ok on my browser
I've seen this before on either Firefox or IE, I cant remember which.
I worked around it by setting an empty placeholder
The problem is on Firefox
It's a firefox bug, reported 7 years ago.
But developers does not fixed yet.
refs:
https://bugzilla.mozilla.org/show_bug.cgi?id=904846
https://bugzilla.mozilla.org/show_bug.cgi?id=550434
https://stackoverflow.com/questions/21986985/firefox-sets-wrong-caret-position-contenteditable-with-before