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
NodeSelector in @firecms/editor caches activeItem on stable editor reference, never updates #826
@firecms/[email protected] (also reproduces against 3.1.0 HEAD on master)
Bug
Inside the bubble-menu NodeSelector, the indicator (label + check mark) for the current block type is frozen on first render. Selecting different types (Heading 1 → Heading 3 → Bullet List, etc.) does not update the selector. It always reports whatever was active first.
Inline mark selectors (bold/italic/strike) update correctly; only the node selector is broken.
Root cause
In packages/editor/src/selectors/node-selector.tsx the React-Compiler-memoized block keys activeItem on the editor reference:
The Tiptap editor instance returned by useCurrentEditor() is stable across selection and document changes, so the cache slot is never invalidated and activeItem remains whatever it was on first render.
Reproduce
Open any markdown field powered by FireCMSEditor.
Type a Heading 1, then a Heading 3 below it (via slash command).
Click into the Heading 1, select text → bubble menu shows "Heading 1" ✓
Click into the Heading 3, select text → bubble menu still shows "Heading 1" ✗
Reproduces on FireCMS 3.x with React 19.
Expected
The selector label and check mark should reflect the block type at the current selection, the same behaviour as the inline mark indicators.
Suggested fix
Compute activeItem outside the memo cache or key the cache on something that actually changes with selection (e.g. editor.state.selection.from plus the active node name).
Hi — I came to work on this and checked the current code on main first. The code path in the report no longer exists: the editor was rewritten from Tiptap to raw ProseMirror, and packages/firecms_core/src/editor/selectors/node-selector.tsx now computes activeItem from state on every render, with state updating on every transaction (including selection changes) via dispatchTransaction → setState in useProseMirror.ts. So the stale-cache mechanism described here looks gone on main. If a maintainer can confirm, this can probably be closed — happy to verify against a current build if there's still a repro.
Activity
TariQMah commentedon Nov 22, 2026
Hi — I came to work on this and checked the current code on main first. The code path in the report no longer exists: the editor was rewritten from Tiptap to raw ProseMirror, and packages/firecms_core/src/editor/selectors/node-selector.tsx now computes activeItem from state on every render, with state updating on every transaction (including selection changes) via dispatchTransaction → setState in useProseMirror.ts. So the stale-cache mechanism described here looks gone on main. If a maintainer can confirm, this can probably be closed — happy to verify against a current build if there's still a repro.