Offcanvas execute multiple time #36942
Answered
by
GeoSot
krosoftware
asked this question in
General
-
Prerequisites
Describe the issueI have simple Bootstrap 5.2 Offcanvas example here: https://stackblitz.com/edit/qw6rdj?file=index.html Please try to click on button more than once. After each click, you will see +1 alert on open and close. Why is that? How to display alert (open and close message) only once on each click? Thank you Reduced test caseshttps://stackblitz.com/edit/qw6rdj?file=index.html What operating system(s) are you seeing the problem on?Windows What browser(s) are you seeing the problem on?Chrome, Microsoft Edge, Opera What version of Bootstrap are you using?v5.2 |
Beta Was this translation helpful? Give feedback.
Answered by
GeoSot
Aug 11, 2022
Replies: 2 comments 1 reply
-
Compress with RTL and join along with css.
…Sent from my iPhone
On 11-Aug-2022, at 3:52 PM, krosoftware ***@***.***> wrote:
Prerequisites
I have searched for duplicate or closed issues
I have validated any HTML to avoid common problems
I have read the contributing guidelines
Describe the issue
I have simple Bootstrap 5.2 Offcanvas example here: https://stackblitz.com/edit/qw6rdj?file=index.html
Please try to click on button more than once. After each click, you will see +1 alert on open and close.
Why is that?
How to display alert (open and close message) only once on each click? Thank you
Reduced test cases
https://stackblitz.com/edit/qw6rdj?file=index.html
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome, Microsoft Edge, Opera
What version of Bootstrap are you using?
v5.2
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Just try to register your listeners once: element.body.addEventListener('myEvent', () => {
console.log('I run only once! 😇');
}, { once: true }); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
krosoftware
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just try to register your listeners once: