Skip to content

fix(Editor): sync changes to the editable prop - #7483

Open
mateusznarowski wants to merge 1 commit into
nuxt:v4from
mateusznarowski:fix/editor-reactive-editable
Open

mateusznarowski wants to merge 1 commit into
nuxt:v4from
mateusznarowski:fix/editor-reactive-editable

Conversation

@mateusznarowski

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #7482

❓ Type of change

  • 📖 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.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ui Ready Ready Preview Nov 24, 2026 12:22am UTC
ui-repl Ready Ready Preview Nov 24, 2026 12:22am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Linked issue reproductions on this pull request playground.

Issue Reproduction
#7482 Open

@github-actions

Copy link
Copy Markdown
Contributor

Client output of the apps in test/bundle that changed, compared to the base branch.

Fixture JS (gzip) CSS (gzip)
nuxt-full 911.3 kB (+26 B, +0.0%) 29.3 kB
Raw sizes
Fixture JS CSS
nuxt-full 2854.7 kB (+54 B, +0.0%) 212.3 kB

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to b66da

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eec7e164-9004-4a68-afb0-c7a90d900db5
Commits

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.

@codspeed

codspeed Bot commented Nov 24, 2026

Copy link
Copy Markdown

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.

Learn more about Macro Runners

See affected benchmarks

❌ 1 regressed benchmark
✅ 32 untouched benchmarks
⏩ 10 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ table (~13 slots) 700.5 µs 969.2 µs -27.73%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing mateusznarowski:fix/editor-reactive-editable (b66da69) with v4 (bf93b9c)

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@7483

commit: b66da69

This branch was successfully deployed

2 active deployments
Preview – ui — b66da69d Deployed Nov 24, 2026 by vercel[bot]
Preview – ui-repl — b66da69d Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggling editable on UEditor does not apply

1 participant