Skip to content

Commit 48d6d77

Browse files
committed
Bump version to 1.767.0 and prevent textarea blur on Enter in preset forms
1 parent f58fd0f commit 48d6d77

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
44
"description": "CWC is a blazing fast AI coding with chatbots/APIs",
5-
"version": "1.766.0",
5+
"version": "1.767.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

‎apps/editor/src/views/panel/frontend/components/edit-preset-form/EditPresetForm/EditPresetForm.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ export const EditPresetForm: React.FC<Props> = (props) => {
521521
}}
522522
onFocus={() => set_active_field('prompt_prefix')}
523523
min_rows={2}
524+
blur_on_enter={false}
524525
/>
525526
</Field>
526527

@@ -543,6 +544,7 @@ export const EditPresetForm: React.FC<Props> = (props) => {
543544
}}
544545
onFocus={() => set_active_field('prompt_suffix')}
545546
min_rows={2}
547+
blur_on_enter={false}
546548
/>
547549
</Field>
548550
</Fieldset>

‎packages/ui/src/components/editor/common/Textarea/Textarea.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type Props = {
99
autofocus?: boolean
1010
min_rows?: number
1111
max_rows?: number
12+
blur_on_enter?: boolean
1213
on_change: (value: string) => void
1314
on_blur?: () => void
1415
on_key_down?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void
@@ -42,7 +43,11 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, Props>(
4243
}, [])
4344

4445
const handle_key_down = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
45-
if ((e.key == 'Enter' || e.key == 'Escape') && !e.shiftKey) {
46+
if (
47+
(e.key == 'Escape' ||
48+
(e.key == 'Enter' && (props.blur_on_enter ?? true))) &&
49+
!e.shiftKey
50+
) {
4651
e.preventDefault()
4752
e.currentTarget.blur()
4853
}

0 commit comments

Comments
 (0)