Bootstrap, from Twitter, is currently the most popular front-end framework. Bootstrap is based on HTML, CSS, and JAVASCRIPT. It is concise and flexible, making Web development faster. However, we still encounter various small problems in the process of use. Today we are discussing how to fix a small BUG that I encountered during use. Bootstrap provides many convenient page controls. modal is one of them. Many people encounter the issue that the esc key cannot be closed when using modal, even if the keyboard option is explicitly passed in, it does not take effect.
$ ('# EditFormItemModal'). modal ({show: true, keyboard: true });
This problem occurs in Versions later than 2.1. It is easy to solve this problem. Add a tabindex attribute to the p where modal is located:
The problem is very simple, and it is very easy to fix. I hope it will help you.