我的问题和这篇文章中发现的完全一样:
TinyMCE 4 insert link form fields disabled
唯一的区别是我使用的是 tinyMCE 5.1.1 版和 jquery mobile。
基本上我已经在 jquery 移动弹出窗口中初始化了 tinyMCE(参见图片链接),当我点击图标插入链接时,除了目标之外的任何字段都不可用于编辑。
我已经尝试过在上一篇文章中找到的代码(稍微调整一下以针对 tinyMCE css 类):这是我已经尝试过的代码:
$(document).on('focusin', function(e) {
if ($(e.target).closest(".tox-editor-container").length) {
console.log("e.stopImmediatePropagation()");
e.stopImmediatePropagation();
}
});
"e.stopImmediatePropagation()"打印在控制台中,但除了目标之外的任何字段都不可用于编辑。
最佳答案
如果是bootstrap的问题,解决方法是:
// Prevent Bootstrap dialog from blocking focusin
$(document).on('focusin', function(e) {
if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
e.stopImmediatePropagation();
}
});
发件人:https://www.tiny.cloud/docs/integrations/bootstrap/#usingtinymceinabootstrapdialog
关于hyperlink - TinyMCE 5.1.1 插入链接表单字段已禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58912965/