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
{{ message }}
Repository navigation
MobileFormattingToolbarController always portals into document.body, ignoring portalElements #3304
Since 0.55, FormattingToolbarController switches to MobileFormattingToolbarController on touch devices while the virtual keyboard is open. The mobile controller hardcodes its portal target:
The portalElements map on BlockNoteView has a formattingToolbar key, and the desktop toolbar respects it. The mobile toolbar, and the dropdowns that portal into the same body-level root, ignore it.
This breaks editors rendered inside a shadow root. The BlockNote styles are loaded into the shadow root, but the mobile toolbar ends up in document.body, outside it. The portal root gets the bn-root / bn-mantine classes and theme variables, but no stylesheet matches them there. On iOS and Android the toolbar renders unstyled: bare Mantine buttons, no toolbar background, and it isn't pinned above the keyboard.
What did you expect to happen?
Keep document.body as the default (I understand it avoids the iOS -webkit-overflow-scrolling stacking issue described in the source), but respect portalElements.formattingToolbar, falling back to portalElements.default, when it is set. Then apps can keep the mobile toolbar inside their shadow root or any other styled container.
Steps to reproduce
Render a BlockNoteView inside a shadow root, and load @blocknote/mantine/style.css only into that shadow root (not into the document).
Passing portalElements={{ formattingToolbar: ... }} doesn't help either, since the mobile controller doesn't read it.
Open the page on a touch device, or emulate one (navigator.maxTouchPoints > 0 and (pointer: coarse)), and focus the editor so the virtual keyboard opens.
The mobile formatting toolbar is appended to document.body, outside the shadow root, and renders unstyled.
Activity
nperez0111 commentedon Nov 5, 2026
Thanks @ihordubas99, we will definitely fix this.