bootstrap provides us with many convenient page controls, modal is one of them. Many people encounter the problem that the esc key cannot be closed when using modal, even if the keyboard option is explicitly passed in, it will not take effect.
$('#editFormItemModal').modal({show:true, keyboard:true});
This problem occurs after 2.1, and it is very simple to solve this problem. Add a tabindex attribute to the div where the modal is located:
<div tabindex="-1">
The problem is very simple and it is very simple to fix. I hope it will be helpful to everyone.