我有一个问题,我不知道如何解决。 我正在使用SweetAlert向用户显示一条消息。 我希望能够选择复制一些下一个,但这似乎并不奏效。
我的Sweet Alert代码是。
swal({
title: "Alert Box Title",
text: "Select any of this text",
type: "warning",
allowEscapeKey: false,
allowOutsideClick: false,
showCancelButton: true,
showConfirmButton: true,
cancelButtonText: "Cancel",
confirmButtonText: "Confirm",
closeOnConfirm: false,
animation: true,
html: true
},
警报本身没有问题 -- 完全按照我的期望工作。 只是没有选择复制文本的能力。 我远不是一个Javascript专家,所以我只是不知道这是一个我遗漏的设置,还是其他一些我需要实现的代码。 谢谢您
更新:使用Chrome开发者工具,我已经确定了问题所在。 当代码生成时,我得到。
<div class="sweet-alert showSweetAlert visible" tabindex="-1" .... >
似乎是tabindex造成的。 It seems to be the tabindex causing it. 如果我使用开发者工具删除这个问题,我就能选择复制,没有问题。 我想我需要深入研究如何改变tabindex,但就是不知道这是否会对警报造成任何不良问题?