Editor cursor forward when I press <Enter> then <space> key under IE11.

2 posts, 0 answers
  1. ChainHome Yang
    ChainHome Yang avatar
    12 posts
    Member since:
    Sep 2009

    Posted 04 Dec 2016 Link to this post

    Hi, Telerik:

    The scenario:
    1. goto http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx
    2. Clear editor's content.
    3. Press <Enter> key. Cursor jump to second line. (expected)
    4. Press <Space> key. Cursor jump to first column of second line (P, Div mode) or first line. (Br mode)

    But if I Press <Shift+Enter> then <Space>, it worked as expected.
    I tried two methods to make <Enter> as <Shift+Enter>, but it worked not fine.

    1. RadEditor "OnClientCommandExecuting"

    function _Editor_onCmdExecuting(oSender, oArgs) {
      if ($telerik.isIE && oArgs.get_commandName() === "EnterNewLine") { oArgs.set_cancel(true); oSender.fire("ShiftEnter", null); }
    }

    or
    2. RadEditor "OnClientLoad" attacted onkeydown event

    function _Editor_onLoad(oSender, oArgs) {
        oSender.attachEventHandler("onkeydown", function (e) {
            if (e.keyCode === 9) { oSender.pasteHtml("&nbsp;&nbsp;&nbsp;&nbsp;"); $telerik.cancelRawEvent(e); }
            else if (e.keyCode === 13) { oSender.pasteHtml("<br>"); $telerik.cancelRawEvent(e); }
        });
    }



    Any idea make <Enter> as <Shift+Enter>?

    Telerik version: 2015.3.1111.40

  2. ChainHome Yang
    ChainHome Yang avatar
    12 posts
    Member since:
    Sep 2009

    Posted 05 Dec 2016 Link to this post

    Sorry, I found this http://www.telerik.com/forums/safari-linebreak-issues

    Please close this thread.

Back to Top