Skip to content

Widget: Avoid tracking remove event handlers for classes options #1769

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

Closed

Conversation

scottgonzalez
Copy link
Member

Fixes #15082
Fixes #15095

@jsf-clabot
Copy link

jsf-clabot commented Nov 16, 2016

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@arschmitz
Copy link
Member

👍

@scottgonzalez
Copy link
Member Author

Updated to avoid leaking event listeners.

@wangchangshan
Copy link

I also find this issue, thanks for your works ~~

@scottgonzalez
Copy link
Member Author

We might need to add a remove event listener to the element that is having classes added so that we untrack the element when it gets removed. This would catch scenarios like autocomplete menus having items created and destroyed constantly.

@scottgonzalez scottgonzalez force-pushed the classes-remove-tracking branch from 979e468 to e8767c9 Compare April 12, 2017 20:43
@scottgonzalez
Copy link
Member Author

Updated to actually work. I confirmed that this fixes all reported issues with the remove event and have updated the commit message to reference all tickets.

Fixes #15078
Fixes #15082
Fixes #15095
Fixes #15136
Fixes #15152
@scottgonzalez scottgonzalez force-pushed the classes-remove-tracking branch from e8767c9 to c87ee3b Compare April 17, 2017 20:45
var isTracked = $.map( that.classesElementLookup, function( elements ) {
return elements;
} )
.some( function( elements ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a single element, so the name should be singular, though element is already taken

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a collection of elements for a single class.

@scottgonzalez scottgonzalez deleted the classes-remove-tracking branch April 19, 2017 16:54
scottgonzalez added a commit that referenced this pull request Apr 19, 2017
Fixes #15078
Fixes #15082
Fixes #15095
Fixes #15136
Fixes #15152
Closes gh-1769
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants