You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/apply-streamed-markdown.test.ts
+37-1Lines changed: 37 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,12 @@ import { afterEach, beforeAll, describe, expect, it } from 'vitest'
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/apply-streamed-markdown.ts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -810,10 +810,10 @@ export function LoadedRichMarkdownEditor({
810
810
if(editor.isEditable===isEditable)return
811
811
// Defer out of the render/commit phase. `isEditable` flips from collab readiness (synced + seeded),
812
812
// which is driven by a Yjs `config.observe` firing synchronously inside `Y.applyUpdate` — so this
813
-
// effect can run while React is mid-render. `setEditable` dispatches a TipTap transaction that the
814
-
// React binding commits with `flushSync`, which throws ("cannot flush while rendering") in that
815
-
// window. A microtask runs right after the current commit, before paint; re-check liveness/value
816
-
// since either can change before it fires.
813
+
// effect can run while React is mid-render. `setEditable` re-applies the view state and emits an
814
+
// `update` that the React binding commits with `flushSync`, which throws ("cannot flush while
815
+
// rendering") in that window. A microtask runs right after the current commit, before paint; re-check
816
+
// liveness/value since either can change before it fires.
0 commit comments