mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
f6a8247c48b6a64dc9c4c7c557ff5559c48d3397
* fix: cursor jumps to end of text when editing a comment When editing a comment mid-text, the cursor would jump to the end after every keystroke, making it impossible to insert text at any position other than the end. Root cause: on each keystroke, the comment editor's onUpdate callback updated parent state (setContent), which changed the defaultContent prop passed back to CommentEditor. A useEffect watching defaultContent then called commentEditor.commands.setContent(), which reset the entire editor content and moved the cursor to the end. Fix: - Store in-progress edits in a ref instead of state to avoid triggering React re-renders and the prop->effect->setContent cascade - Read from the ref when saving the comment - Sync the ref back into state after a successful save so the read-only view updates immediately - Guard the setContent useEffect to only run for read-only editors, so websocket-driven updates from other browsers still work Fixes #1791 Functionally tested on Firefox and Chrome: mid-text editing, saving, cross-browser live updates via websocket. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix stale content on edit cancel --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Philipinho <16838612+Philipinho@users.noreply.github.com>
Docmost
Open-source collaborative wiki and documentation software.
Website |
Documentation |
Twitter / X
Getting started
To get started with Docmost, please refer to our documentation or try our cloud version .
Features
- Real-time collaboration
- Diagrams (Draw.io, Excalidraw and Mermaid)
- Spaces
- Permissions management
- Groups
- Comments
- Page history
- Search
- File attachments
- Embeds (Airtable, Loom, Miro and more)
- Translations (10+ languages)
Screenshots
License
Docmost core is licensed under the open-source AGPL 3.0 license.
Enterprise features are available under an enterprise license (Enterprise Edition).
All files in the following directories are licensed under the Docmost Enterprise license defined in packages/ee/License.
- apps/server/src/ee
- apps/client/src/ee
- packages/ee
Contributing
See the development documentation
Thanks
Special thanks to;
Crowdin for providing access to their localization platform.
Algolia for providing full-text search to the docs.
Description
No description provided
confluencedocumentationknowledge-basemediawikinotionnotion-alternativeopen-sourceopensourcerealtime-collaborationwiki
Readme
AGPL-3.0
35 MiB
Languages
TypeScript
96%
CSS
3.8%

