From 0f873e5df2f975fac3ddc03740ad204d5b505a20 Mon Sep 17 00:00:00 2001 From: ScottSut Date: Mon, 9 Mar 2020 19:48:34 +0800 Subject: [PATCH] fix: dashboard initial resize incorrect --- webapp/app/containers/Dashboard/Grid.tsx | 5 +++++ webapp/share/containers/Dashboard/index.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/webapp/app/containers/Dashboard/Grid.tsx b/webapp/app/containers/Dashboard/Grid.tsx index b2cf77c50..2e54284b8 100644 --- a/webapp/app/containers/Dashboard/Grid.tsx +++ b/webapp/app/containers/Dashboard/Grid.tsx @@ -816,6 +816,10 @@ export class Grid extends React.Component { + this.props.onResizeAllDashboardItem() + } + private onWindowResize = () => { if (this.resizeSign) { clearTimeout(this.resizeSign) @@ -1740,6 +1744,7 @@ export class Grid extends React.Component { ) } + private onBreakpointChange = () => { + this.onWindowResize() + } + private onWindowResize = () => { if (this.resizeSign) { clearTimeout(this.resizeSign) @@ -1052,6 +1056,7 @@ export class Share extends React.Component { breakpoints={GRID_BREAKPOINTS} cols={GRID_COLS} layouts={layouts} + onBreakpointChange={this.onBreakpointChange} measureBeforeMount={false} useCSSTransforms={false} isDraggable={false}