From f72d932db5ce523385591958939a135d716a286d Mon Sep 17 00:00:00 2001 From: Joel Parke Date: Wed, 9 Nov 2016 17:19:45 -0700 Subject: [PATCH] fix (taBind): don't deselect after 1000ms after applying styling #1381 - thanks to damien-otis for this fix --- src/taBind.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/taBind.js b/src/taBind.js index 341db223..06d12b69 100644 --- a/src/taBind.js +++ b/src/taBind.js @@ -957,6 +957,7 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM' if(_inputTimeout) $timeout.cancel(_inputTimeout); /* istanbul ignore next: cant' test? */ _inputTimeout = $timeout(function() { + var _savedSelection = rangy.saveSelection(); var _val = _compileHtml(); if (_val !== ngModel.$viewValue) { //console.log('_setViewValue'); @@ -964,6 +965,7 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM' //console.log('new:', _val); _setViewValue(_val, true); } + rangy.restoreSelection(_savedSelection); }, 1000); } });