From ac808add1ab4be58eb60addfd737a41f4d6ee797 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Fri, 29 May 2026 17:12:02 +0800 Subject: [PATCH] fix(editor): record undo snapshot on mouseup to preserve cursor position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The undo system's lazy snapshot mechanism did not capture cursor position when user clicked to move it, causing cursor to jump to a stale position after Ctrl+Z. 修复编辑器撤销时光标跳转到错误位置的问题,在mouseup时记录快照 以保存正确的光标位置。 Log: 修复撤销时光标位置跳转错误 PMS: BUG-332099 Influence: 用户点击移动光标后输入内容再撤销,光标现在会正确地 保持在点击位置,而不是跳转到之前的旧位置。 --- src/web/js/summernote_v9_2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/js/summernote_v9_2.js b/src/web/js/summernote_v9_2.js index e81a3b37b..e8e93e4e7 100644 --- a/src/web/js/summernote_v9_2.js +++ b/src/web/js/summernote_v9_2.js @@ -4256,6 +4256,7 @@ }).on('mouseup', function (event) { if (event.which !== 3) { _this.context.triggerEvent('mouseup', event); + _this.history.recordUndo(); } }).on('scroll', function (event) { _this.context.triggerEvent('scroll', event);