We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a73caed commit acd496dCopy full SHA for acd496d
1 file changed
packages/super-editor/src/extensions/comment/comments-plugin.js
@@ -285,12 +285,13 @@ export const CommentsPlugin = Extension.create({
285
const newActiveThreadId = meta.activeThreadId;
286
287
// Emit commentsUpdate event when active comment changes (e.g., from comment bubble click)
288
+ // Defer emission to after transaction completes to avoid dispatching during apply()
289
if (previousActiveThreadId !== newActiveThreadId) {
290
const update = {
291
type: comments_module_events.SELECTED,
292
activeCommentId: newActiveThreadId ? newActiveThreadId : null,
293
};
- editor.emit('commentsUpdate', update);
294
+ setTimeout(() => editor.emit('commentsUpdate', update), 0);
295
}
296
297
pluginState.activeThreadId = newActiveThreadId;
0 commit comments