[PR #2343] [MERGED] Need to set the cursor to the correct position, after the DOM node is updated #5194

Closed
opened 2026-03-23 22:17:39 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/2343
Author: @qinluhe
Created: 4/24/2023
Status: Merged
Merged: 4/25/2023
Merged by: @qinluhe

Base: developHead: feat/document-cursor


📝 Commits (1)

  • c3cce2c fix: set cursor after operation

📊 Changes

17 files changed (+438 additions, -215 deletions)

View changed files

📝 frontend/appflowy_tauri/src/appflowy_app/components/document/HeadingBlock/index.tsx (+9 -3)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/ListBlock/ColumnListBlock.tsx (+10 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/ListBlock/index.tsx (+15 -19)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/TextBlock/TextBlock.hooks.ts (+61 -50)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/TextBlock/index.tsx (+2 -4)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/TextInput.hooks.ts (+112 -97)
📝 frontend/appflowy_tauri/src/appflowy_app/interfaces/document.ts (+5 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts (+20 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/backspace.ts (+53 -28)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/insert.ts (+5 -1)
frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/set_cursor.ts (+47 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/split.ts (+5 -1)
frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/update.ts (+39 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/slice.ts (+20 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/utils/block.ts (+32 -1)
📝 frontend/rust-lib/flowy-document2/src/event_handler.rs (+2 -2)
📝 frontend/rust-lib/flowy-document2/src/manager.rs (+1 -1)

📄 Description

Feature Preview

  • Need to set the cursor to the correct position, after the DOM node is updated

PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/2343 **Author:** [@qinluhe](https://github.com/qinluhe) **Created:** 4/24/2023 **Status:** ✅ Merged **Merged:** 4/25/2023 **Merged by:** [@qinluhe](https://github.com/qinluhe) **Base:** `develop` ← **Head:** `feat/document-cursor` --- ### 📝 Commits (1) - [`c3cce2c`](https://github.com/AppFlowy-IO/AppFlowy/commit/c3cce2cf16e58529795e38cc7f7d875af7becc87) fix: set cursor after operation ### 📊 Changes **17 files changed** (+438 additions, -215 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/HeadingBlock/index.tsx` (+9 -3) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/ListBlock/ColumnListBlock.tsx` (+10 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/ListBlock/index.tsx` (+15 -19) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/TextBlock/TextBlock.hooks.ts` (+61 -50) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/TextBlock/index.tsx` (+2 -4) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/TextInput.hooks.ts` (+112 -97) 📝 `frontend/appflowy_tauri/src/appflowy_app/interfaces/document.ts` (+5 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts` (+20 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/backspace.ts` (+53 -28) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/insert.ts` (+5 -1) ➕ `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/set_cursor.ts` (+47 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/split.ts` (+5 -1) ➕ `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async_actions/update.ts` (+39 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/slice.ts` (+20 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/utils/block.ts` (+32 -1) 📝 `frontend/rust-lib/flowy-document2/src/event_handler.rs` (+2 -2) 📝 `frontend/rust-lib/flowy-document2/src/manager.rs` (+1 -1) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview - [x] Need to set the cursor to the correct position, after the DOM node is updated <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:17:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#5194
No description provided.