Skip to content

Commit f79e3aa

Browse files
committed
Remove container click-to-focus and add footer click-to-select-all functionality
1 parent 4efa4cc commit f79e3aa

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

packages/ui/src/components/editor/ChatInput/ChatInput.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ export const ChatInput: React.FC<Props> = (props) => {
208208
}
209209
}
210210

211-
const handle_container_click = () => {
212-
textarea_ref.current?.focus()
213-
}
214-
215211
const placeholder = useMemo(() => {
216212
const active_history = props.chat_history
217213

@@ -259,7 +255,6 @@ export const ChatInput: React.FC<Props> = (props) => {
259255
props.is_in_code_completions_mode &&
260256
(props.has_active_selection || !props.has_active_editor)
261257
})}
262-
onClick={handle_container_click}
263258
onKeyDown={(e) => {
264259
if (e.key == 'f' && (e.ctrlKey || e.metaKey)) {
265260
e.stopPropagation()
@@ -340,8 +335,18 @@ export const ChatInput: React.FC<Props> = (props) => {
340335
/>
341336
)}
342337

343-
<div className={styles.footer}>
344-
<div className={styles.footer__left}>
338+
<div
339+
className={styles.footer}
340+
onClick={() => {
341+
textarea_ref.current?.select()
342+
}}
343+
>
344+
<div
345+
className={styles.footer__left}
346+
onClick={(e) => {
347+
e.stopPropagation()
348+
}}
349+
>
345350
{!props.is_in_code_completions_mode && (
346351
<button
347352
onClick={props.on_at_sign_click}
@@ -352,7 +357,12 @@ export const ChatInput: React.FC<Props> = (props) => {
352357
</button>
353358
)}
354359
</div>
355-
<div className={styles.footer__right}>
360+
<div
361+
className={styles.footer__right}
362+
onClick={(e) => {
363+
e.stopPropagation()
364+
}}
365+
>
356366
{props.token_count !== undefined && props.token_count > 1 && (
357367
<div
358368
className={styles.footer__right__count}

0 commit comments

Comments
 (0)