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
fix(Editor): sync changes to the editable prop - #7483
📖 Documentation (updates to the documentation or readme)
🐞 Bug fix (a non-breaking change that fixes an issue)
👌 Enhancement (improving an existing functionality)
✨ New feature (a non-breaking change that adds functionality)
🧹 Chore (updates to the build process or auxiliary tools and libraries)
⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
UEditor applied editable only when creating the editor. Changes to the prop now update the existing Tiptap instance and preserve the document without emitting update:modelValue.
The regression test covers switching between editable and read-only modes in both directions and restoring the default when the prop is removed.
No actionable comments were generated in the recent review.
Walkthrough
The Editor component now watches for changes to the editable prop and calls setEditable with the new value. If the prop is undefined, it uses true. A new test checks the contenteditable attribute after prop changes and confirms that the editor instance and HTML remain unchanged, with no update:modelValue event.
UEditor now applies later changes to the editable prop to the live editor without altering content or emitting model updates. A regression test covers the change, and no merge-blocking risk is identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the main change: the Editor component now applies later changes to the editable prop. It matches the raw summary, which shows a watcher on props.editable calling editor.setEditable. T…
Description check
The description matches the changeset. It explains that UEditor applied editable only at creation, that prop changes now update the existing Tiptap instance, and that a regression test covers both mod…
Linked Issues check
Issue #7482 requires that toggling the editable prop on UEditor takes effect after the first render. The diff at the reviewed head adds a watch on () => props.editable in `src/runtime/componen…
Out of Scope Changes check
The whole-PR diff from the merge base to the reviewed head touches src/runtime/components/Editor.vue (+4 lines, the new watcher) and, per the summary, test/components/Editor.spec.ts (+24 lines, th…
Full details: Title check
Explanation
The title states the main change: the Editor component now applies later changes to the editable prop. It matches the raw summary, which shows a watcher on props.editable calling editor.setEditable. The conventional commit prefix is clear and specific.
Full details: Description check
Explanation
The description matches the changeset. It explains that UEditor applied editable only at creation, that prop changes now update the existing Tiptap instance, and that a regression test covers both mode switches and the default reset. The linked issue and bug-fix type are also stated.
Full details: Linked Issues check
Explanation
Issue #7482 requires that toggling the editable prop on UEditor takes effect after the first render. The diff at the reviewed head adds a watch on () => props.editable in src/runtime/components/Editor.vue. The watcher calls editor.value?.setEditable(editable ?? true, false). This updates the existing Tiptap instance. The second argument false prevents an update:modelValue emission, and the document is not replaced. The unset value defaults to true, which matches the initial editor creation. The PR summary reports a regression test in test/components/Editor.spec.ts that covers false to true, back to false, and undefined. The test was not inspected directly, but the source change alone implements the requested behaviour. The issue has no further acceptance criteria. The change is a coding change and no non-coding requirements apply.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff from the merge base to the reviewed head touches src/runtime/components/Editor.vue (+4 lines, the new watcher) and, per the summary, test/components/Editor.spec.ts (+24 lines, the regression test). Both changes directly implement or verify the editable prop synchronisation requested by #7482. No unrelated changes were identified in the summary or the inspected diff.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between bf93b9c and b66da69.
Files selected for processing: 2
src/runtime/components/Editor.vue
test/components/Editor.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Merging this PR will degrade performance by 27.73%
1 warning
⚠️1 benchmark with a significant change ran on different hardware
Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.
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
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.
🔗 Linked issue
Resolves #7482
❓ Type of change
📚 Description
UEditorappliededitableonly when creating the editor. Changes to the prop now update the existing Tiptap instance and preserve the document without emittingupdate:modelValue.The regression test covers switching between editable and read-only modes in both directions and restoring the default when the prop is removed.
📝 Checklist