Fix renderSpec crash in TextInputWithMentions#2299
Merged
Conversation
The renderHTML option in tiptap's Mention extension expects a ProseMirror DOMOutputSpec (array format), but generateMentionHtmlElement was returning an actual DOM Element. This caused ProseMirror to throw 'RangeError: Invalid array passed to renderSpec' when opening Code block step settings. Rewrote generateMentionHtmlElement to return a proper DOMOutputSpec array. Added integration test to catch regressions when rendering mention nodes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the mention rendering path in TextInputWithMentions so Tiptap/ProseMirror receives a valid DOMOutputSpec instead of a DOM element.
Changes:
- Converts mention HTML generation to return a ProseMirror array-based DOM spec.
- Adds tests covering rendering plain text, single mentions, mention attributes, and multiple mentions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts |
Updates mention rendering to return a DOMOutputSpec. |
packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/tests/text-input-with-mentions.test.tsx |
Adds regression coverage for rendering mentions in the editor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
ravikiranvm
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Fixes
RangeError: Invalid array passed to renderSpeccrash when clicking on a Code block step in the flow builder.Why
The
renderHTMLoption in tiptap's Mention extension expects a ProseMirrorDOMOutputSpec(array format like['span', {attrs}, ...children]), butgenerateMentionHtmlElementwas returning an actual DOM Element. When ProseMirror tried to process it as an array spec, it threw the RangeError.How
generateMentionHtmlElementto return a properDOMOutputSpecarray instead of a DOM nodePart of OPS-4334.