Allow pasting images (#472)

Fixes #283
This commit is contained in:
Will Chen
2025-06-23 15:33:21 -07:00
committed by GitHub
parent 37fb643f6f
commit fa1fb9cc4d
3 changed files with 50 additions and 1 deletions

View File

@@ -97,6 +97,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
handleDragLeave,
handleDrop,
clearAttachments,
handlePaste,
} = useAttachments();
// Use the hook to fetch the proposal
@@ -309,6 +310,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onKeyPress={handleKeyPress}
onPaste={handlePaste}
placeholder="Ask Dyad to build..."
className="flex-1 p-2 focus:outline-none overflow-y-auto min-h-[40px] max-h-[200px]"
style={{ resize: "none" }}

View File

@@ -37,6 +37,7 @@ export function HomeChatInput({
handleDragLeave,
handleDrop,
clearAttachments,
handlePaste,
} = useAttachments();
const adjustHeight = () => {
@@ -103,6 +104,7 @@ export function HomeChatInput({
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onKeyPress={handleKeyPress}
onPaste={handlePaste}
placeholder="Ask Dyad to build..."
className="flex-1 p-2 focus:outline-none overflow-y-auto min-h-[40px] max-h-[200px]"
style={{ resize: "none" }}