Skip to content

Commit

Permalink
fix(taBind): Catch edge case on mouseup handler when no children
Browse files Browse the repository at this point in the history
Fixes #446
  • Loading branch information
SimeonC authored and SimeonC committed Dec 17, 2014
1 parent c877991 commit e114089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/taBind.js
Expand Up @@ -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
Expand Down

0 comments on commit e114089

Please sign in to comment.