Skip to content

Commit

Permalink
fix: we should remove all event listeners when calling destroy (#556)
Browse files Browse the repository at this point in the history
- this is to avoid having events leaking in memory from possible detached elements
  • Loading branch information
ghiscoding authored Nov 26, 2020
1 parent 69a6b86 commit 708b070
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 2090,22 @@ if (typeof Slick === "undefined") {
$container.off(".slickgrid");
removeCssRules();

$canvas.off("draginit dragstart dragend drag");
$canvas.off();
$viewport.off();
$headerScroller.off();
$headerRowScroller.off();
if ($footerRow) {
$footerRow.off();
}
if ($footerRowScroller) {
$footerRowScroller.off();
}
if ($preHeaderPanelScroller) {
$preHeaderPanelScroller.off();
}
$focusSink.off();
$(".slick-resizable-handle").off();
$(".slick-header-column").off();
$container.empty().removeClass(uid);
if (shouldDestroyAllElements) {
destroyAllElements();
Expand Down

0 comments on commit 708b070

Please sign in to comment.