Skip to content

Commit

Permalink
Merge pull request #11 from josephj/#10
Browse files Browse the repository at this point in the history
#10 Fix - Image dimension not updating after window resizing
  • Loading branch information
josephj authored Nov 5, 2018
2 parents 343feca + 0aff6fc commit f847b12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-justified-grid",
"version": "0.0.2",
"version": "0.0.3",
"description": "Rendering grid layout without cropping image",
"author": "josephj",
"license": "MIT",
Expand Down
5 changes: 2 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getRowHeight, updateProcessedImageList } from './utils';

class JustifiedGrid extends React.Component<Props, State> {
private wrapperEl: HTMLDivElement | null;
private debounceResizeHandler: any;
public static defaultProps: DefaultProps = {
gutter: 1,
rows: 3,
Expand All @@ -24,10 +25,8 @@ class JustifiedGrid extends React.Component<Props, State> {
images: [],
gridHeight: 0
};
this.debounceResizeHandler = debounce(this.handleWindowResize, 300);
}
debounceResizeHandler = (): void => {
debounce(this.handleWindowResize, 300);
};
handleWindowResize = (): void => {
this.sync();
};
Expand Down

0 comments on commit f847b12

Please sign in to comment.