Skip to content

Commit 95dc7a8

Browse files
authored
feat: support moving cursor with home and end keys (#918)
* feat: support moving cursor with home and end keys * docs: add release notes
1 parent 6aec9cb commit 95dc7a8

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

docs/content.en/docs/release-notes/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Information about release notes of Coco App is provided here.
1515

1616
feat: support switching groups via keyboard shortcuts #911
1717
feat: support opening logs from about page #915
18+
feat: support moving cursor with home and end keys #918
1819

1920
### 🐛 Bug fix
2021

src/components/Search/AssistantManager.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ export function useAssistantManager({
147147

148148
handleSubmit();
149149
}
150+
151+
if (key === "Home") {
152+
e.preventDefault();
153+
return currentTarget.setSelectionRange(0, 0);
154+
}
155+
156+
if (key === "End") {
157+
e.preventDefault();
158+
const length = currentTarget.value.length;
159+
return currentTarget.setSelectionRange(length, length);
160+
}
150161
},
151162
[
152163
isChatMode,

0 commit comments

Comments
 (0)