I am trying to remove selection inside a contenteditable field. The code I have is this:
Text
An answer here solved my problem, but it got deleted for some reason. It was this:
Replacing $('h1').blur() with window.getSelection().removeAllRanges();" fixed it.
$('h1').blur()
window.getSelection().removeAllRanges();"