boostrap 3模态,焦点输入字段不在fi​​refox上工作

sul*_*man 9 javascript firefox google-chrome bootstrap-modal twitter-bootstrap-3

我正在使用bootstrap 3中的modal,它包含在输入字段中

当加载页面时(不是通过单击按钮),使用jquery代码启动此模式

$().ready(function()
{
    $('#OTPModal').modal('show');
});
Run Code Online (Sandbox Code Playgroud)

一旦显示模态,我就会通过此代码使输入成为焦点

$('#OTPModal').on('shown.bs.modal', function () 
{
    $('#OTPField').focus();
});
Run Code Online (Sandbox Code Playgroud)

这段代码在谷歌浏览器中运行良好,但它不在Firefox中!

用chrome和firefox检查jsFiddle以查看不同的内容

https://jsfiddle.net/aq9Laaew/272015/

firefox版本:63.0.1(64位)

chrome版本:版本70.0.3538.77(官方版本)(64位)

sae*_*hem 0

这个问题来自 Firefox 中的小提琴站点。查看您的代码,无需摆弄 iframe。 https://fiddle.jshell.net/aq9Laaew/272015/show/