mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 19:47:43 +01:00
feat: allow navigate back when cursor is at the beginning (#940)
* feat: allow navigate back when cursor is at the beginning * docs: update changelog
This commit is contained in:
@@ -20,8 +20,10 @@ feat: support pageup/pagedown to navigate search results #920
|
|||||||
feat: standardize multi-level menu label structure #925
|
feat: standardize multi-level menu label structure #925
|
||||||
feat(View Extension): page field now accepts HTTP(s) links #925
|
feat(View Extension): page field now accepts HTTP(s) links #925
|
||||||
feat: return sub-exts when extension type exts themselves are matched #928
|
feat: return sub-exts when extension type exts themselves are matched #928
|
||||||
|
feat: allow navigate back when cursor is at the beginning #940
|
||||||
feat: open quick ai with modifier key + enter #939
|
feat: open quick ai with modifier key + enter #939
|
||||||
|
|
||||||
|
|
||||||
### 🐛 Bug fix
|
### 🐛 Bug fix
|
||||||
|
|
||||||
fix: automatic update of service list #913
|
fix: automatic update of service list #913
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ export function useAssistantManager({
|
|||||||
const handleKeyDownAutoResizeTextarea = useCallback(
|
const handleKeyDownAutoResizeTextarea = useCallback(
|
||||||
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
const { key, shiftKey, currentTarget } = e;
|
const { key, shiftKey, currentTarget } = e;
|
||||||
const { value } = currentTarget;
|
const { value, selectionStart } = currentTarget;
|
||||||
|
|
||||||
if (key === "Backspace" && value === "") {
|
if (key === "Backspace" && (value === "" || selectionStart === 0)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
return navigateBack();
|
return navigateBack();
|
||||||
|
|||||||
Reference in New Issue
Block a user