在Bootstrap模式下显示SweetAlert2

我试图在bootstrap的模态上添加一个sweetalert组件,问题是该模态有一个属性'tabindex'并且focus属性不能按预期工作,我找到了一个我想补充的解决方案,我删除了'tabindex'属性,然后将焦点放在我想要的按钮上。

如果您还有其他解决方案,我想知道!

sweet.fire({
          position: 'top',title: 'ARE YOU SURE TO UPDATE THIS ITEM?',type: 'info',showCancelButton: true,confirmButtonColor: '#3085d6',cancelButtonColor: '#d33',confirmButtonText: 'Continuar',cancelButtonText: 'Cancelar',reverseButtons: true,allowOutsideclick:false,onOpen:() => {   
                       document.getElementById("modal_categoria_form").removeAttribute('tabindex');
                       sweet.getconfirmButton().focus();     
           }
         })
do11223 回答:在Bootstrap模式下显示SweetAlert2

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3122228.html

大家都在问