【发布时间】:2021-09-11 05:11:45
【问题描述】:
我在运行 Bootstrap 4 模态时调用了一个 Alertify Confirmation 对话框,问题是选项卡焦点在第一个不工作,而在最后一个。
我相信这与“tabindex=-1”有关...
我认为可行的概念之一是在 Alertify onshow 和 onclose 事件期间从“modal”类 div 元素切换“tabindex=-1”,但仍然无法正常工作!
let mymessage = "Update entry?";
alertify.confirm().set({title: "Confirm!"})
.set({labels: {ok:"Yes", cancel:"No"}})
.set("defaultFocus", "ok");
.set({onshow:function(){$(".modal").attr("tabindex","-2");}})
.set({onclose:function(){$(".modal").attr("tabindex","-1");}});
// Show confirmation message
alertify.confirm(mymessage, function(e){
if(e){
editRow();
} else {
alertify.notify("Entry update has been canceled!");
}
}).bringToFront();
看看在 Alertify Confirmation 对话框中缺失的 Tab 序列是否仍在 Modal Div 中!
感谢您的支持!
【问题讨论】:
标签: javascript html jquery bootstrap-4 alertify