diff --git a/lib/taBind.js b/lib/taBind.js index b557e1ae..1849cdfc 100644 --- a/lib/taBind.js +++ b/lib/taBind.js @@ -454,7 +454,7 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM' element.on('mouseup', function(){ var _selection = taSelection.getSelection(); - if(_selection.start.element === element[0]) taSelection.setSelectionToElementStart(element.children()[0]); + if(_selection.start.element === element[0] && element.children().length) taSelection.setSelectionToElementStart(element.children()[0]); }); // prevent propagation on mousedown in editor, see #206