]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Doc: fix 'Events' JS example
authorJulien Déramond <juderamond@gmail.com>
Thu, 4 May 2023 18:37:46 +0000 (20:37 +0200)
committerMark Otto <markdotto@gmail.com>
Thu, 1 Jun 2023 02:32:01 +0000 (19:32 -0700)
site/content/docs/5.3/getting-started/javascript.md

index 8efb2fb00ac8d3b45cc04c69a8a80dbaa006222e..80c222fcd04e34fb185784da3e76f9b122fc3474 100644 (file)
@@ -118,9 +118,7 @@ All infinitive events provide [`preventDefault()`](https://developer.mozilla.org
 const myModal = document.querySelector('#myModal')
 
 myModal.addEventListener('show.bs.modal', event => {
-  if (!data) {
-    return event.preventDefault() // stops modal from being shown
-  }
+  return event.preventDefault() // stops modal from being shown
 })
 ```