feat: handle image paste in AI toolbar textarea via onPaste handler
This commit is contained in:
@@ -33,6 +33,7 @@ import {
|
||||
} from "@/components/ui/popover";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { extractImageFromClipboard } from "@/lib/clipboard-image";
|
||||
import {
|
||||
SHORTCUT_DEFINITIONS,
|
||||
detectOs,
|
||||
@@ -192,6 +193,13 @@ export const AIToolbar = ({
|
||||
setAiPrompt("");
|
||||
}
|
||||
}}
|
||||
onPaste={(e) => {
|
||||
const image = extractImageFromClipboard(e.clipboardData ?? null);
|
||||
if (image) {
|
||||
e.preventDefault();
|
||||
onImageSelect(image);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Attached image preview */}
|
||||
|
||||
Reference in New Issue
Block a user