Completed
Last Updated: 25 Sep 2014 14:41 by ADMIN
ADMIN
Ianko
Created on: 01 Aug 2014 06:20
Category: UI for ASP.NET AJAX
Type: Bug Report
0
An 'a' character appears when pressing Enter after tracked text when Tracking Changes is disabled
This issue causes an additional ghost character to appear in the text without any incorrect user interaction. 


For the time being you can incorporate the JavaScript code from the following example:

<telerik:RadEditor runat="server" ID="RadEditor1" EnableTrackChanges="true">
	<Tools>
		<telerik:EditorToolGroup>
			<telerik:EditorTool name="AcceptTrackChange" text="Accept Track Change" />
			<telerik:EditorTool name="RejectTrackChange" text="Reject Track Change" />
			<telerik:EditorTool name="AcceptAllTrackChanges" text="Accept All Track Changes" />
			<telerik:EditorTool name="RejectAllTrackChanges" text="Reject All Track Changes" />
			<telerik:EditorTool name="EnableTrackChangesOverride" text="Enable Track Changes Override" />
		</telerik:EditorToolGroup>
	</Tools>
</telerik:RadEditor>

<script type="text/javascript">
	(function () {
		var $E = Telerik.Web.UI.Editor;
		var utils = $E.Utils;
		var isTypingKey = utils.isTypingKey;
		utils.isTypingKey = function (e) {
			return e.keyCode != 13 && isTypingKey(e);
		}

		var extractFrom = $E.InsertParagraphCommand.prototype.extractFrom;
		$E.InsertParagraphCommand.prototype.extractFrom = function (cursor, container) {
			var newElement = extractFrom.call(this, cursor, container);
			if (!this.get_editor().get_enableTrackChanges() || utils.isTextNode(cursor.nextSibling)) return newElement;
			$telerik.$(newElement).find("*").each(function (index, item) {
				if ($E.TrackChangesUtils.isTrackChangeElement(item)) {
					if (utils.isTag(item, "ins") || utils.isTag(item, "del")) {
						utils.removeNode(item);
						return;
					}
					$E.TrackChangesUtils.removeNodeTracking(item);
				}
			});
			return newElement;
		}
	}());
</script>
0 comments