Skip to content

Commit

Permalink
fix(InfiniteGrid): fix items' is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jan 11, 2019
1 parent 59ddabd commit a7c7637
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DOMRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ export default class DOMRenderer {
public getViewportSize() {
return this._size.viewport;
}
public getContainerSize() {
return this._size.container;
}
public setContainerSize(size: number) {
this._size.container = size;
this.container.style[this.options.horizontal ? "width" : "height"] = `${size}px`;
}
public resize() {
Expand Down
3 changes: 3 additions & 0 deletions src/InfiniteGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ class InfiniteGrid extends Component {
isChildren: true,
});
} else {
if (renderer.getContainerSize()) {
renderer.setContainerSize(0);
}
this._requestAppend({});
}
return this;
Expand Down

0 comments on commit a7c7637

Please sign in to comment.