2

我有一个带有文本区域的甜蜜警报,按空格键时窗口正在关闭。

 swal({
            title: 'Something Went Wrong',
            text: '<textarea id="my-textarea" name="my-textarea" rows="5" />',
            type: 'error',
            showCancelButton: true,
            confirmButtonText: 'Yes, Refresh Page',
            confirmButtonClass: 'btn-danger',
            html: true
        }

我可以防止这种行为吗?

4

2 回答 2

1

我有同样的问题,我这样解决了:如果你使用 le min js,在 sweet-alert.min.js 中检索这部分代码“ =n.keyCode||n.which,a=k(m,” visible");if(-1!==[9,13 " 并删除数组中代表空格键的 ascii 代码的下一个“ 32 ”。

于 2016-03-23T16:05:22.227 回答
0

我有评论第 388 行,并且能够让窗口不关闭。

//fireClick($targetElement, e);
于 2016-01-11T09:31:01.360 回答