brianvoe / slim-select

Slim advanced select dropdown
http://slimselectjs.com
MIT License
1.05k stars 200 forks source link

Destroy method now properly removes the eventListeners #491

Closed andy-UKC closed 11 months ago

andy-UKC commented 1 year ago

The valueChange() function was bound (to this) before both adding and removing the eventListener. In both cases this would create a new reference to the function.

Now the resulting function of the bind is passed to the eventListener, and can be used to remove it in destroy()

brianvoe commented 11 months ago

Im sure there was a reason I did this but ill give your branch a shot and see if it still works