私はモーダルです。 OKボタンがあります。私はボタンに焦点を当てたい。私はオートフォーカスを試みましたが、それは1秒間焦点を合わせてから離れます。Bootstrap OKボタンでオートフォーカスしたいモーダル
_Layout.cshtml内のコードは次のとおりです。
<!-- modal that can notify users of errors -->
<div id="error-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="error-modal" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">Notice</h4>
</div>
<div class="modal-body">
<ul>
<!-- ko foreach: ModalErrors -->
<li data-bind="text: $data"></li>
<!-- /ko -->
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
少ないファイル内のコードは次のとおりです。
#error-modal, #info-modal, #action-modal {
.modal-dialog {
z-index: 1100;
}
.modal-content {
border-radius: 0 4px;
//border-radius: 0;
ul {
padding-left: 20px;
}
}
.modal-footer {
button {
border-radius: 0;
}
.btn-primary {
background-color: @seal-yellow;
border-color: @seal-grey;
color: @seal-black;
}
}
}
素晴らしい - それがあなたを助けたら答えを受け入れてください – 83N