Fix current width calc
This commit is contained in:
parent
a5d173a1f2
commit
fb04db7b54
@ -170,7 +170,7 @@ class App extends Component {
|
||||
bottomRight: false, bottomLeft: false, topLeft: false }}
|
||||
onResize={(e, direction, ref) => {
|
||||
const { compactUserList } = this.state;
|
||||
const shouldBeCompact = (e.clientX - ref.offsetLeft) <= USERLIST_COMPACT_WIDTH;
|
||||
const shouldBeCompact = ref.clientWidth <= USERLIST_COMPACT_WIDTH;
|
||||
if (compactUserList === shouldBeCompact) return;
|
||||
this.setState({ compactUserList: shouldBeCompact });
|
||||
}}
|
||||
|
@ -24,7 +24,7 @@ const propTypes = {
|
||||
roving: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
const UserListContainer = (props) => <UserList {...props} />;
|
||||
const UserListContainer = props => <UserList {...props} />;
|
||||
|
||||
UserListContainer.propTypes = propTypes;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user