I need to focus on an object after closing the modal bootstrap
In the bootstrap.dialog (old) I can do it because I can program in the event close of the close button, but the bootstrap 4 close is generic.
The idea would be as below:
$("#btneditar").on("click", function () {
var codcli = $("#codcli").val();
if (codcli <= 0) {
$("#aviso").modal();
$(".body-aviso").html("Escolha o cliente para editar");
$("#codcli").focus();
} else {
url = "minha url";
window.location = url;
}
});
As we know the (obj) focus line has lost focus when closing modal
How to circumvent this situation?