Skip to content

Commit

Permalink
use forEach instead of for...in
Browse files Browse the repository at this point in the history
to prevent loop from breaking when Array prototype has been modified in running environment
  • Loading branch information
pixel9 committed Aug 27, 2020
1 parent ca5acf6 commit e438fde
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scrollgrid/src/ScrollGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,7 @@ export class ScrollGrid extends BaseComponent<ScrollGridProps, ScrollGridState>

let stickyScrollings = this.getStickyScrolling(argsByKey)

for (let key in stickyScrollings) {
stickyScrollings[key].updateSize()
}
stickyScrollings.forEach(stickyScrolling => stickyScrolling.updateSize())

this.stickyScrollings = stickyScrollings
}
Expand Down

0 comments on commit e438fde

Please sign in to comment.