-
Notifications
You must be signed in to change notification settings - Fork 300
feat(TextEditor): prose-v3 typography and code block improvements #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2fde537
feat(TextEditor): prose-v3 styles, code block light/dark themes, lang…
netchampfaris a71191d
docs(TextEditor): update PROSE_V3.md with full implementation details
netchampfaris 3df9443
fix: remove height property for empty paragraphs
netchampfaris f876847
fix(prose-v3): empty paragraph height handling
netchampfaris e33b27e
fix(TextEditor): restore prose-sm default and prose-v2, make prose-v3…
netchampfaris 9818e6e
fix: prose-p-spacing class for smoother migration
netchampfaris 3357f62
chore(text-editor): remove prose v3 design note
netchampfaris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Does TipTap editor.on() return an unbind function?💡 Result:
No, TipTap's editor.on does not return an unbind function. It follows a standard EventEmitter pattern where editor.on(event, callback) adds the listener but returns the editor instance (this) for chaining. To unbind, use editor.off(event, callback) with the exact same callback reference. This is shown in the official documentation with examples like: const onUpdate = => { ... }; editor.on('update', onUpdate); editor.off('update', onUpdate);
Citations:
Missing event listener cleanup — potential memory leak.
The
editor.on('update', ...)listener is registered inmounted()but never removed. This will leak memory if the component is mounted/unmounted multiple times. TipTap uses a standard EventEmitter pattern: to unbind, calleditor.off(event, callback)with the same callback reference inbeforeUnmount().🐛 Proposed fix: store callback and call editor.off() on unmount
data() { return { isEditable: this.editor.isEditable, + onUpdate: null, } }, mounted() { - this.editor.on('update', () => { + this.onUpdate = () => { this.isEditable = this.editor.isEditable - }) + } + this.editor.on('update', this.onUpdate) }, + beforeUnmount() { + if (this.onUpdate) { + this.editor.off('update', this.onUpdate) + } + },🤖 Prompt for AI Agents