fix(editor): use 'strike' mark name for inspector strikethrough#3567
Open
Btocode wants to merge 1 commit into
Open
fix(editor): use 'strike' mark name for inspector strikethrough#3567Btocode wants to merge 1 commit into
Btocode wants to merge 1 commit into
Conversation
The typography inspector's Format row passes item.value directly into editor.chain().toggleMark(value), but the Strikethrough entry used the CSS text-decoration value 'line-through' instead of the tiptap mark name 'strike'. Clicking it threw "There is no mark type named 'line-through'" and the pressed state never reflected (activeMarks is keyed by 'strike' via MARK_NAMES). Aligns with BubbleMenuStrike. Fixes resend#3560
Contributor
|
@Btocode is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 731aea2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Fixes a bug in the tiptap editor by correcting a mark name. However, this changes behavior in the core editor UI and involves understanding of internal tiptap extension naming, which is best reviewed by a human to avoid regressions.
Re-trigger cubic
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.
Fixes #3560
Problem
Clicking Strikethrough in the typography inspector (
Inspector.Text→ Format row) throws and does nothing:The
BubbleMenustrikethrough works; only the inspector button is affected.Root cause
FORMAT_ITEMSinpackages/editor/src/ui/inspector/config/text-config.tsxdefined the strikethrough entry with the CSStext-decorationvalueline-throughas the mark identifier:But
typography.tsxpassesitem.valuestraight into the tiptap command:There is no tiptap mark named
line-through, so the toggle throws. The pressed state was also alwaysfalse, becauseactiveMarksis keyed byMARK_NAMES = ['bold','italic','underline','strike','code'].Fix
Use the tiptap mark name
strike(matchingBubbleMenuStrikeinui/bubble-menu/strike.tsx):This fixes both the throw and the pressed-state indicator.
Scope / not changed
MARK_TOGGLESkeepsline-through— it uses an explicittoggleStrikecommand andtext-block-utilsmaps from the storedtext-decorationvalue (covered by an existing test).TEXT_DECORATION_ITEMSkeepsline-through— those are genuine CSStext-decorationvalues.A changeset is included (
@react-email/editorpatch).Summary by cubic
Fix the Strikethrough button in the typography inspector in
@react-email/editorby using the tiptap mark namestrikeinstead of the CSS valueline-through. This removes the runtime error and restores the pressed state.Written for commit 731aea2. Summary will update on new commits.