When my content editable <div>
(chat field) gets blurred, the keyboard closes but the (blue) cursor remains visible.
Is there a way to hide the cursor?
<div class="chat-message" contenteditable="true" data-ph="Typ een bericht..."></div>
When my content editable <div>
(chat field) gets blurred, the keyboard closes but the (blue) cursor remains visible.
Is there a way to hide the cursor?
<div class="chat-message" contenteditable="true" data-ph="Typ een bericht..."></div>
After searching some more I stumbled on the following topic: How can I blur a div where contentEditable=true?
It seems that content editable works a bit different than normal textareas. You have to clear the selection, which actually sounds really obvious when you think about it..
So what works for me is the following:
$('#chat .chat-footer .chat-actions .chat-message').on('blur', function () {
window.getSelection().removeAllRanges();
});