title: Closing bootstrap modal using ESC
body: <p>I am using 2 modals, 1st one contains a form and 2nd shows up when an error occurs in the form. 2nd modal contains only text with error message.</p>
  
  <p>My problem is that when 2nd modal show up and I press <kbd>Esc</kbd>, the first one (with the form) will close instead on the 2nd one.</p>
  
  <p>Is there any way how to focus the 2nd modal when it shows up?</p>
  
  <p><img src="https://i.stack.imgur.com/h4PC3.png" alt="enter image description here"></p>
  
  <p>This is how it looks like, now if I pressed <kbd>Esc</kbd>, the 1st one would close, but I want to close the 2nd one first.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Once I click somewhere on the 2nd modal, it works perfectly. I just need to select/focus it automatically</p>