且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TinyMCE 内联拖放图像上传不起作用

更新时间:2023-12-03 13:50:04

我认为您的问题可能与自 TinyMCE 5.4 以来存在的 block_unsupported_drop 选项有关,请参阅 https://www.tiny.cloud/docs/configure/file-image-upload/#block_unsupported_drop.

I think your problem might be related to the block_unsupported_drop option that exists since TinyMCE 5.4, see https://www.tiny.cloud/docs/configure/file-image-upload/#block_unsupported_drop.

我注意到了与您相同的问题(不支持丢弃的文件类型" 通知)并验证了如果我将 block_unsupported_drop 设置为 false(内联模式下的 TinyMCE 5.5).

I noticed the same problem as you ("Dropped file type is not supported" notification) and verified it no longer exists for me if I set block_unsupported_drop to false (TinyMCE 5.5 in inline mode).

这是 TinyMCE 中的相关代码:

That's the relevant code in TinyMCE: https://github.com/tinymce/tinymce/blob/91e7f357ca8db3aeaa6f48c7efa97eb8c5c39fbb/modules/tinymce/src/core/main/ts/DragDropOverrides.ts#L281-L297

老实说,我不太明白在什么情况下可能需要防止删除,但看起来这个选项是作为删除图像后浏览器导航错误修复的一部分引入的(https://github.com/tinymce/tinymce/commit/c0205609360a1adb7e3d9061f043009b686a8ca1366c5如果您了解更多信息,请告诉我.

To be honest, I don't quite understand under what circumstances preventing the drop might be required, but it looks like the option was introduced as part of a fix for faulty browser navigation after dropping images (https://github.com/tinymce/tinymce/commit/c020562dadb7e3d9061f043009b686a8ca1366c5). Let me know if you find out more.