Commit 2359da7
Render the selected static inner block synchronously
Blocks with `innerContent` support portal their inner blocks directly
via `InnerContent`, bypassing the per-block `AsyncModeProvider` the block
list wraps around each child. As a result the selected inner block runs
in async mode, so its `useSelect` subscriptions (including the rich text
selection) invalidate on a deferred schedule. While typing, a
content-driven re-render can then read a stale selection offset before
the deferred invalidation lands, corrupting the caret.
Wrap each portalled inner block in an `AsyncModeProvider` keyed on its
selection, matching the block list, so the selected block renders
synchronously and its selection stays current.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent af53431 commit 2359da7
1 file changed
Lines changed: 18 additions & 7 deletions
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
| |||
0 commit comments