From 5ab09fd155c8fcf52065c2bbddcb643575b5e515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Thu, 4 May 2023 20:37:46 +0200 Subject: [PATCH] Doc: fix 'Events' JS example --- site/content/docs/5.3/getting-started/javascript.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/site/content/docs/5.3/getting-started/javascript.md b/site/content/docs/5.3/getting-started/javascript.md index 8efb2fb00ac8..80c222fcd04e 100644 --- a/site/content/docs/5.3/getting-started/javascript.md +++ b/site/content/docs/5.3/getting-started/javascript.md @@ -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 }) ```