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

dropdown.dispose() does not remove event listeners #32983

Closed
jirikanda opened this issue Feb 4, 2021 · 2 comments · Fixed by #33000
Closed

dropdown.dispose() does not remove event listeners #32983

jirikanda opened this issue Feb 4, 2021 · 2 comments · Fixed by #33000
Labels

Comments

@jirikanda
Copy link

Dropdown has a dispose() function which contains:

super.dispose()
EventHandler.off(this._element, EVENT_KEY)
...

Unfortunatelly, in the base class BaseComponent there is the dispose() function which contains

Data.removeData(this._element, this.constructor.DATA_KEY)
this._element = null

When dropdown dispose() function is called

  1. this._element is set to null in the super.dispose()
  2. EventHandler.off function(...) cannot remove event listener because the this._element is null.
@hakenr
Copy link

hakenr commented Feb 4, 2021

...and in EventHandler.off(this._element, EVENT_KEY), the EVENT_KEY is weird: .bs.carousel

@XhmikosR
Copy link
Member

XhmikosR commented Feb 5, 2021

Can someone submit a PR please? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants