@@ -275,6 +275,12 @@ export function MarkdownInput(props: Props) {
275
275
276
276
cm . current = CodeMirror . fromTextArea ( node , {
277
277
...options ,
278
+ // dragDrop=false: instead of useless codemirror dnd, we upload file and make link.
279
+ // Note that for the md editor or other full code editors, we DO want dragDrop true,
280
+ // since, e.g., you can select some text, then drag it around, which is useful. For
281
+ // a simple chat message or tiny bit of markdown (like this is for), that's not so
282
+ // useful and drag-n-drop file upload is way better.
283
+ dragDrop : false ,
278
284
// IMPORTANT: there is a useEffect involving options below
279
285
// where the following four properties must be explicitly excluded!
280
286
inputStyle : "contenteditable" as "contenteditable" , // needed for spellcheck to work!
@@ -616,7 +622,6 @@ export function MarkdownInput(props: Props) {
616
622
}
617
623
618
624
function handle_paste_event ( _ , e ) : void {
619
- // console.log("handle_paste_event", e);
620
625
const items = e . clipboardData . items ;
621
626
for ( let i = 0 ; i < items . length ; i ++ ) {
622
627
const item = items [ i ] ;
@@ -909,11 +914,6 @@ export function MarkdownInput(props: Props) {
909
914
style = { { height : "100%" , width : "100%" } }
910
915
dropzone_ref = { dropzone_ref }
911
916
close_preview_ref = { upload_close_preview_ref }
912
- config = {
913
- // only images work since when pasting other doc types
914
- // things blow up (due to conflict with codemirror?)
915
- { acceptedFiles : "image/*" }
916
- }
917
917
>
918
918
{ body }
919
919
</ BlobUpload >
0 commit comments