Skip to content

Commit 5a4512f

Browse files
committed
fix(*): components are not down sizing on orientation change
This change requires the next version of react-viewport-utils to be in place because it implements the dimensions.clientWidth property.
1 parent 84df18c commit 5a4512f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/StickyPlaceholder.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class StickyPlaceholder extends React.Component<IProps, IState> {
4444
}
4545

4646
static getDerivedStateFromProps(props: IProps, state: IState): IState | null {
47-
const nextClientSize = `${props.dimensions.width}`;
47+
const { width, clientWidth } = props.dimensions;
48+
const nextClientSize = `width:${width},clientWidth:${clientWidth}`;
4849
if (state.isRecalculating) {
4950
const stickyRect = props.stickyRef.current.getBoundingClientRect();
5051
return {

0 commit comments

Comments
 (0)