This is a migrated thread and some comments may be shown as answers.

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

1 Answer 61 Views
Editor
This is a migrated thread and some comments may be shown as answers.
ChainHome Yang
Top achievements
Rank 1
ChainHome Yang asked on 05 Dec 2016, 02:57 AM

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

1 Answer, 1 is accepted

Sort by
0
ChainHome Yang
Top achievements
Rank 1
answered on 05 Dec 2016, 09:14 AM

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

Please close this thread.

Tags
Editor
Asked by
ChainHome Yang
Top achievements
Rank 1
Answers by
ChainHome Yang
Top achievements
Rank 1
Share this question
or