Completed
Last Updated: 27 Mar 2019 18:12 by ADMIN
ADMIN
Nikolay
Created on: 02 Aug 2016 10:12
Category: UI for ASP.NET AJAX
Type: Bug Report
0
TrackChanges delete functionality skips spaces
Steps to Reproduce:
1) bold a non tracked word
2) Append an "s" (or other letter) to the previous non tracked word
3) delete the space between the previous word and the bolded word

Actual: the tracking will delete the first letter of the bolded word

Expected: the space should be deleted

Workaround:
<telerik:RadEditor ID="RadEditor1" runat="server" EnableTrackChanges="true">
	<Content>
		<p>some plain text</p>
	</Content>
</telerik:RadEditor>
<script>
	(function ($, $E, undefined) {
		var utils = $E.Utils;
		utils.isInlineSpace = utils.isInlineSpace || function (node) {
			return utils.isTextNodeEmpty(node) && node.previousSibling && node.nextSibling &&
				!utils.isBlockElement(node.previousSibling) && !utils.isBlockElement(node.nextSibling);
		};
		var isSignificantTextNode = function (node) {
			return utils.isTextNode(node) && (!utils.isTextNodeEmpty(node) || utils.isInlineSpace(node));
		};
		var prototype = $E.PlainTextSelector.prototype;
		$E.PlainTextSelector = function (toLeft, topNode) {
			this.toLeft = toLeft;
			var condition = toLeft ?
								function (node, position) { return isSignificantTextNode(node) && (position > 0 && position <= node.nodeValue.length); } :
								function (node, position) { return isSignificantTextNode(node) && (position >= 0 && position < node.nodeValue.length); };

			this.traverser = new $E.DomTreeTraverser(condition, topNode);
		};
		$E.PlainTextSelector.prototype = prototype;
	})($telerik.$, Telerik.Web.UI.Editor);
</script>
0 comments