diff --git a/site/content/docs/5.3/components/modal.md b/site/content/docs/5.3/components/modal.md index 3ca7cc4d2240..fe6dcd9d64cf 100644 --- a/site/content/docs/5.3/components/modal.md +++ b/site/content/docs/5.3/components/modal.md @@ -868,4 +868,11 @@ const myModalEl = document.getElementById('myModal') myModalEl.addEventListener('hidden.bs.modal', event => { // do something... }) + +myModalEl.addEventListener('hide.bs.modal', event => { + // you can also abort the event... + if (!valid) { + return event.preventDefault() + } +}) ```