【问题标题】:ckeditor's popup input fields dont work when used with bootstrap 5 modal (ckeditor 4)与 bootstrap 5 modal (ckeditor 4) 一起使用时,ckeditor 弹出输入字段不起作用
【发布时间】:2022-04-04 22:10:58
【问题描述】:

我在 bootstrap 5 模态中使用 ckeditor 时遇到了一个错误,看起来这是一个众所周知的错误,许多人已经为不同的 bootstrap 版本提供了解决方案,但我无法为 bootstrap 5 找出一个错误,请看看吧。

这是解决方案的问题:- https://stackoverflow.com/a/31679096

其他类似问题:-

CKEditor Plugin: text fields not editable

Bootstrap with CKEditor equals problems

主要是引导程序 5 的下一行的替代方案。$.fn.modal.Constructor.prototype.enforceFocus

如果我在 bootstrap 4 js 文件中搜索它,我可以在其中找到 fn.modal.Constructor 但在 bootstrap 5 中找不到。如果有人可以根据 bootstrap 5 在上述链接中重新创建经过验证的解决方案,它会非常感谢。感谢您的宝贵时间。

image describing problem

还有一些注意事项:-

  1. 复选框和下拉菜单等所有其他输入类型都有效,但不仅仅是文本字段。

  2. 我也尝试从引导模式代码中删除 tabindex="-1" 但问题仍然存在。

【问题讨论】:

  • 请拨打tour。解决方案不会出现在您的问题中。

标签: javascript html jquery ckeditor bootstrap-5


【解决方案1】:

不确定您是否找到了答案,但我在 sweetalert2 模式中遇到了同样的问题。我搜索了bootstrap的源代码,发现可以这样去掉焦点:

$.fn.modal.Constructor.prototype._initializeFocusTrap = function () { return { activate: function () { }, deactivate: function () { } } };

从 Bootstrap 5.1.3 开始工作

【讨论】:

    猜你喜欢
    • 2020-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-15
    • 2019-04-18
    • 1970-01-01
    • 1970-01-01
    • 2021-01-02
    相关资源
    最近更新 更多