fix: Clear the input when the user changes mode within a task (#4242)
* Clear the input when the user changes mode within a task * Add changeset * rename prop
This commit is contained in:
1 parent
189b91ca36
commit
d8e29263df
3 files changed
+11
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Clear the chat input when the user changes mode within a task
|
||||
@@ -81,6 +81,7 @@ interface ChatTextAreaProps {
|
||||
shouldDisableFilesAndImages: boolean
|
||||
onHeightChange?: (height: number) => void
|
||||
onFocusChange?: (isFocused: boolean) => void
|
||||
isTaskView: boolean
|
||||
}
|
||||
|
||||
interface GitCommit {
|
||||
@@ -268,6 +269,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
|
||||
shouldDisableFilesAndImages,
|
||||
onHeightChange,
|
||||
onFocusChange,
|
||||
isTaskView,
|
||||
},
|
||||
ref,
|
||||
) => {
|
||||
@@ -1015,6 +1017,9 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
|
||||
)
|
||||
// Focus the textarea after mode toggle with slight delay
|
||||
setTimeout(() => {
|
||||
if (isTaskView) {
|
||||
setInputValue("")
|
||||
}
|
||||
textAreaRef.current?.focus()
|
||||
}, 100)
|
||||
}, changeModeDelay)
|
||||
|
||||
@@ -1306,6 +1306,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
|
||||
scrollToBottomAuto()
|
||||
}
|
||||
}}
|
||||
isTaskView={!!task}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user