Skip to content

Offcanvas execute multiple time #36942

Answered by GeoSot
krosoftware asked this question in General
Discussion options

You must be logged in to vote

Just try to register your listeners once:

element.body.addEventListener('myEvent', () => {
    console.log('I run only once! 😇');
  }, { once: true });

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@krosoftware
Comment options

Answer selected by krosoftware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #36941 on August 11, 2022 10:46.