Disable "keyboard" option in Bootstrap modal instance and then enable it back on Photoswipe events
20:22 10 Jan 2025

I need to disable the "Esc" button in the Bootstrap modal instance when the Photoswipe instance is open to prevent closing the modal with that key when closing the lightbox.

I get "Maximum call stack size exceeded" when trying to disable "keyboard" option in the modal instance and then enable it back on the lightbox events:

error in console





  
  
  Lightbox in modal
  
  



  

  

  
  
  

  


javascript bootstrap-modal photoswipe