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

Issue with text selection using keyboard Ctrl+Left arrow

1 Answer 69 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Bernard
Top achievements
Rank 1
Bernard asked on 27 Dec 2019, 03:49 PM

There's an oddity when using shift and the left arrow key to select text, where it will skip the first character and then start over. This only happens when using the left arrow, and only at the last word in a line, which makes me think that there's something strange going on with how whatever this is treats the ends of lines.

Highlighting using arrow keys top to bottom and right to left seems fine. But highlighting left to right and bottom to top, seems to cut off highlighting and it doesn't highlight the text as you expect, but instead un-highlights sections you've previously highlighted. 

Reproducible here https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx 

Any help would be appreciated.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Dec 2019, 03:42 PM

Hi Bernard,

Happy Holidays!

Thank you for reporting this issue. It is a known one so please vote for it in the this feedback item.

Until it gets resolved you can workaround the issue by overriding the _onKeyUp internal function of RadEditor:

<script>
    if (Telerik.Web.Browser.chrome) {
        Telerik.Web.UI.RadEditor.prototype._onKeyUp = function (e) {
            this._clearInlineEditModeTabListener(e.keyCode);
 
            this._cleanUpAfterDelete();
 
            if (!this._shortcutHit && Telerik.Web.UI.Editor.Utils.isTypingKey(e)) {
                this._normalizeInsertedText();
            }
 
            //NEW UNDO/REDO
            if (this._hasDeleteExecuted) {
                //No such command when in IE back is called when selection is table or img
                if (this._pendingTextTypeCmd)
                    this.executeCommand(this._pendingTextTypeCmd);
                this._pendingTextTypeCmd = null; //!
                this._hasDeleteExecuted = false;
                return;
            }
 
            if (this._pendingTextTypeCmd) {
                return;
            }
 
            if (this._pendingCutCommand) {
                this.executeCommand(this._pendingCutCommand);
                this._pendingCutCommand = null;
            }
 
            if (this._shortcutHit) {
                return false;
            }
            // this.raiseEvent("selectionChange", Sys.EventArgs.Empty);
        }
    }
</script>
<telerik:RadEditor ID="RadEditor1" runat="server">
    <Content>This <strong>strange</strong> thing</Content>
</telerik:RadEditor>

Regards,
Rumen
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
Bernard
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or