Я получаю " Превышен максимальный размер стека вызовов» при попытке отключить опцию «клавиатура» в модальном экземпляре, а затем снова включить ее в событиях лайтбокса:

Код: Выделить всё
Lightbox in modal
Open Image Gallery
Image Gallery
[url=https://picsum.photos/id/12/800/400]
[img]https://picsum.photos/id/12/800/400[/img]
[/url]
[url=https://picsum.photos/id/28/800/400]
[img]https://picsum.photos/id/28/800/400[/img]
[/url]
[url=https://picsum.photos/id/10/800/400]
[img]https://picsum.photos/id/10/800/400[/img]
[/url]
Previous
Next
document.addEventListener('DOMContentLoaded', function () {
const modalElement = document.getElementById('modal');
modalElement.addEventListener('shown.bs.modal', function () {
let modalInstance = bootstrap.Modal.getOrCreateInstance(modalElement);
const lightbox = new PhotoSwipeLightbox({
gallery: '#gallery',
children: 'a',
pswpModule: PhotoSwipe
});
lightbox.init();
lightbox.on('afterInit', () => {
modalInstance._config.keyboard = false;
});
lightbox.on('close', () => {
modalInstance._config.keyboard = true;
});
});
});
Подробнее здесь: https://stackoverflow.com/questions/793 ... it-back-on