Skip to content

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

Open
@aram88888

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions