Hi,
For my plugin I need to clear selection when editor loses the input focus,
but I can't really figure it how to do that.
In the API doc, for the selectRanges(ranges) method it said:
So I tried :
but nothing happens.
Doesn't work either.
So how to clear selection in ckeditor ?
Thanks
For my plugin I need to clear selection when editor loses the input focus,
but I can't really figure it how to do that.
In the API doc, for the selectRanges(ranges) method it said:
Clears the original selection and adds the specified ranges to the document selection.
So I tried :
editor.on( 'blur', function(e) { ... var ranges =editor.getSelection().getRanges()[0]; editor.getSelection().selectRanges([ranges]); });
but nothing happens.
editor.getSelection().reset();
Doesn't work either.
So how to clear selection in ckeditor ?
Thanks
Try this
Try this
editor.getSelection().removeAllRanges()