Completed
Last Updated: 13 Nov 2025 13:24 by ADMIN
Release 2026 Q1 (Feb)
Narendran
Created on: 13 Nov 2025 10:48
Category: Editor
Type: Bug Report
0
Related to the Undo operation
hank you for providing the script details — the previous JavaScript error has now been resolved.
However, we noticed a new behavior related to the Undo operation:
Steps to reproduce:
  1. In Design mode, select all text (Ctrl + A) and delete it.
  2. Switch to HTML mode.
  3. Switch back to Design mode.
  4. Press Ctrl + Z (Undo).
Observed behavior:
  • The first Ctrl + Z has no effect; the deleted text is restored only after pressing Ctrl + Z a second time.
Could you please check this and give your feedback.
1 comment
ADMIN
Rumen
Posted on: 13 Nov 2025 12:01

Hi Narendran,

Actually this is not a newly introduced behavior. I am able to replicate it even without the suggested improvement in my earlier reply.

Can you please test the following solution to resolve the issue:

<script>
 $E.RangeHolder.prototype.set_html = function(content, title, setFocus, raiseSelChanged) {
        var modeEnum = $T.EditModes;

        if (this.get_mode() != modeEnum.Html)// If design or preview modes
        {
            if (title) {
                var cmd = new $T.Editor.GenericCommand(title, this.get_contentWindow(), this);
                this.executeCommand(cmd, setFocus);
            }

            this._initContentAreaHtml(content);

            if (false != raiseSelChanged) { this.raiseEvent('selectionChange', Sys.EventArgs.Empty); }

            // show empty messsage last since selectionChange would hide it otherwise
            if (this.get_emptyMessage() && (!content || content.trim().length == 0) && this.get_mode() == modeEnum.Design) {
                this._setEmptyMessage();
                // move focus to toolbar to make sure user has to click in the editor to remove the empty message
                $T.Editor.CommandList['SetToolFocus']('SetToolFocus', this, null);
            }
        } else {
            // Set content in HTML MODE
            this._setContentAsText(content);
        }
    }
</script>

 

Let me know the result.

Regards,
Rumen
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources