Skip to content

Commit d5f51c8

Browse files
committed
Fixed an issue where only the last found listener passed to GridApi.prototype.suppressEvents would actually be suppressed. (The foundListeners variable was being overwritten at each iteration.)
1 parent c0d9b48 commit d5f51c8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/js/core/factories/GridApi.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@
176176
var listeners = angular.isArray(listenerFuncs) ? listenerFuncs : [listenerFuncs];
177177

178178
//find all registered listeners
179-
var foundListeners = [];
180-
listeners.forEach(function (l) {
181-
foundListeners = self.listeners.filter(function (lstnr) {
182-
return l === lstnr.handler;
179+
var foundListeners = self.listeners.filter(function(listener) {
180+
return listeners.some(function(l) {
181+
return listener.handler===l;
183182
});
184183
});
185184

0 commit comments

Comments
 (0)