Mee*_*hia 7 html javascript jquery ckeditor bootstrap-5
我在 Bootstrap 5 模式中使用 ckeditor 时遇到了一个错误,它看起来是一个众所周知的错误,许多人已经针对不同的 Bootstrap 版本给出了解决方案,但我无法找出 Bootstrap 5 的解决方案,请看一下。
这是解决方案的问题:- /sf/answers/2217536751/
其他类似问题:-
主要是 bootstrap 5 的以下行的替代方案是什么。 $.fn.modal.Constructor.prototype.enforceFocus
如果我在 bootstrap 4 js 文件中搜索它,我可以在那里找到 fn.modal.Constructor 但在 bootstrap 5 中找不到。如果有人可以根据 bootstrap 5 在上面的链接中重新创建经过验证的解决方案,我们将非常感激。感谢您的时间。
还有一些注意事项:-
所有其他输入类型(例如复选框和下拉列表)都可以使用,但不仅仅是文本字段。
我还尝试从引导模式代码中删除 tabindex="-1" 但问题仍然存在。
小智 2
不确定您是否找到了答案,但我在 sweetalert2 模式中也遇到了同样的问题。我搜索了 bootstrap 的源代码,发现可以用以下方法删除焦点:
$.fn.modal.Constructor.prototype._initializeFocusTrap = function () { return { activate: function () { }, deactivate: function () { } } };
Run Code Online (Sandbox Code Playgroud)
从 Bootstrap 5.1.3 开始工作