Skip to content

Commit 731cfc5

Browse files
authored
feat: allow navigate back when cursor is at the beginning (#940)
* feat: allow navigate back when cursor is at the beginning * docs: update changelog
1 parent cbd8dc5 commit 731cfc5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ feat: support pageup/pagedown to navigate search results #920
2020
feat: standardize multi-level menu label structure #925
2121
feat(View Extension): page field now accepts HTTP(s) links #925
2222
feat: return sub-exts when extension type exts themselves are matched #928
23+
feat: allow navigate back when cursor is at the beginning #940
2324
feat: open quick ai with modifier key + enter #939
2425

26+
2527
### 🐛 Bug fix
2628

2729
fix: automatic update of service list #913

src/components/Search/AssistantManager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ export function useAssistantManager({
103103
const handleKeyDownAutoResizeTextarea = useCallback(
104104
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
105105
const { key, shiftKey, currentTarget } = e;
106-
const { value } = currentTarget;
106+
const { value, selectionStart } = currentTarget;
107107

108-
if (key === "Backspace" && value === "") {
108+
if (key === "Backspace" && (value === "" || selectionStart === 0)) {
109109
e.preventDefault();
110110

111111
return navigateBack();

0 commit comments

Comments
 (0)