Completed
Last Updated: 11 Nov 2024 14:33 by ADMIN
ADMIN
Ianko
Created on: 23 Dec 2015 07:18
Category: Editor
Type: Bug Report
1
InlineEditCompleted is fired when selecting text in RadEditor and releasing mouse button outside the content area
It is a common scenario users to start selecting text and accidental trigger mouseup event outside of the content area. Still, the focus is inside RadEditor and InlineEditCompleted event should not fire.

Possible workaround:

<telerik:RadEditor runat="server" ID="RadEditor1" EditType="Inline"
    OnClientLoad="OnClientLoad" OnClientInlineEditCompleted="OnClientInlineEditCompleted">
    <Content>
       some text
    </Content>
</telerik:RadEditor>

<script>
    function OnClientInlineEditCompleted(sender, args) {
        if (sender._editCompleted) {
            alert("Fired!");
        }
    }

    function OnClientLoad(sender, args) {
        $telerik.$(document).on("mouseup", function (e) {
            if (e.target === sender.get_contentArea() || e.target === sender.get_textArea()) {
                sender._editCompleted = true;
            }
        })

        $telerik.$(document).on("mousedown", function (e) {
            if (e.target === sender.get_contentArea() || e.target === sender.get_textArea()) {
                sender._editCompleted = false;
            } else {
                sender._editCompleted = true;
            }
        })
    }
</script>

1 comment
ADMIN
Rumen
Posted on: 11 Nov 2024 14:32
Not reproducible with the latest version 2024 Q3.