Commit 40241b3
authored
tiptap: fix focus issue when editor not mounted (tldraw#7043)
tiptap: fix focus issue when editor not mounted
### Change type
- [x] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
### Release notes
- tiptap: fix minor focus issue if editor isn't mounted yet
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Guard Tiptap toolbar actions and active-state checks when the editor
view isn't mounted to prevent focus errors.
>
> - **Rich Text Toolbar (`DefaultRichTextToolbarContent.tsx`)**:
> - Add guard to avoid invoking Tiptap operations when `textEditor.view`
is undefined.
> - Compute `isActive` defensively using `textEditor.view ? ... : false`
to prevent access before mount.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
299507f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent e6ed9ae commit 40241b3
1 file changed
Lines changed: 4 additions & 1 deletion
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | | - | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
0 commit comments