feat: support moving cursor with home and end keys (#918)

* feat: support moving cursor with home and end keys

* docs: add release notes
This commit is contained in:
BiggerRain
2025-10-11 15:38:15 +08:00
committed by GitHub
parent 6aec9cbae2
commit 95dc7a88d2
2 changed files with 12 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ Information about release notes of Coco App is provided here.
feat: support switching groups via keyboard shortcuts #911
feat: support opening logs from about page #915
feat: support moving cursor with home and end keys #918
### 🐛 Bug fix

View File

@@ -147,6 +147,17 @@ export function useAssistantManager({
handleSubmit();
}
if (key === "Home") {
e.preventDefault();
return currentTarget.setSelectionRange(0, 0);
}
if (key === "End") {
e.preventDefault();
const length = currentTarget.value.length;
return currentTarget.setSelectionRange(length, length);
}
},
[
isChatMode,