Completed
Last Updated: 05 Feb 2016 11:41 by ADMIN
ADMIN
Vessy
Created on: 23 Nov 2015 12:27
Category: Editor
Type: Bug Report
3
The content of RadEditor is not scrolled properly after paste
The content is not scrolled to the end of the pasted content in IE11 - the scrollbar keeps its initial position instead. The issue is reproducible in IE (tested in IE11) and Chrome, but not in Firefox nor standard editable iframe.

Steps to reproduce:
1. Open in IE: http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx
2. Paste big enough content, so the scrollbar will be shown

Actual: The scrollbar stays on the top.
Expected: The content area is scrolled to the end of the pasted content

Possible workaround could be creating a temporary selectable element after the pasted content, which to be selected manually:
		<telerik:RadEditor ID="txtMessage"  runat="server" OnClientPasteHtml="OnClientPasteHtml">
		</telerik:RadEditor>
		<script>
			function OnClientPasteHtml(editor, args) {
				if (args.get_commandName() == "Paste" && $telerik.isIE) {
					args.set_value(args.get_value() + "<div id='selectableEl'></div>");
					setTimeout(function () {
						var selectedEl = editor.get_document().getElementById("selectableEl");
						console.log(editor.getSelectedElement());
						Telerik.Web.UI.Editor.Utils.scrollTo(selectedEl, editor);
						$telerik.$(selectedEl).remove();
					}, 0);
				}
			}
		</script>
0 comments