Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only first event listener is cleared for the id. #1746

Open
aram88888 opened this issue Dec 13, 2024 · 0 comments
Open

Only first event listener is cleared for the id. #1746

aram88888 opened this issue Dec 13, 2024 · 0 comments
Labels

Comments

@aram88888
Copy link

aram88888 commented Dec 13, 2024

The Problem

  1. Add two listeners for the event (for example 'end') and instance id (for example 1031).
  2. Call off to remove all listeners for the id like this howl.off('end', undefined, 1031).
    Only first one will be cleared.

Reproducible Example

No response

Reproduction Steps

const sound = new Howl({ src: ['sound.mp3'] }); const id = sound.play() sound.on('end', ()=>{console.log(1)}, id); sound.on('end', ()=>{console.log(2)}, id); /*intending to clear all listeners for the event*/ sound.off('end', undefined, id);

Possible Solution

remove break in the for loop

Context

No response

Howler.js Version

2.2.4

Affected Browser(s)/Versiuon(s)

No response

@aram88888 aram88888 added the bug label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant