Repository navigation
Commit c4a2d9c
committed
docs(core): explain what the parent hop in isWithinEditor is actually for
The previous wording said it covers "UI rendered as a sibling of the
content" without saying which UI that is — and BlockNote's own default
UI is entirely portalled (a mounted editor's container has exactly two
children: the content element and the portal), so on its own that
justification doesn't hold up.
The real case is UI the host app passes as `BlockNoteView` children,
which React renders as siblings of the content element. The shipped
"Static Formatting Toolbar" example is exactly that: `<FormattingToolbar />`
rendered inline rather than through a controller, putting eleven
focusable buttons next to the content. Without the hop, focusing one of
them reads as "outside the editor", which would dismiss the mobile
toolbar mid-interaction and trip the side menu's click-outside check.1 parent cdb2a5d commit c4a2d9c
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
802 | | - | |
803 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
804 | 811 | | |
805 | 812 | | |
806 | 813 | | |
| |||
0 commit comments