Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit e726f19

Browse files
committed
Issue fixes #621
1 parent 08573f5 commit e726f19

File tree

3 files changed

+48
-36
lines changed

3 files changed

+48
-36
lines changed

client/src/components/AddToGroupModal/index.jsx

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from "react";
2-
import { List } from "react-virtualized";
2+
import { List, AutoSizer } from "react-virtualized";
33
import PT from "prop-types";
44

55
import Button from "../Button";
@@ -237,24 +237,27 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
237237
<h3 className={style.subTitle}>
238238
My groups{loadingGroups && " (Loading...)"}
239239
</h3>
240-
<div>
241-
{!loadingGroups && (
242-
<List
243-
className={style.groupsList}
244-
width={listWidth}
245-
height={
246-
filteredMyGroups.length > 10
247-
? 450
248-
: filteredMyGroups.length * 45
249-
}
250-
rowCount={filteredMyGroups.length}
251-
rowHeight={45}
252-
rowRenderer={(params) =>
253-
rowRenderer({ ...params, items: filteredMyGroups })
254-
}
255-
/>
256-
)}
257-
</div>
240+
241+
{!loadingGroups && (
242+
<AutoSizer disableHeight>
243+
{() => (
244+
<List
245+
className={style.groupsList}
246+
width={listWidth + 20}
247+
height={
248+
filteredMyGroups.length > 10
249+
? 450
250+
: filteredMyGroups.length * 45
251+
}
252+
rowCount={filteredMyGroups.length}
253+
rowHeight={45}
254+
rowRenderer={(params) =>
255+
rowRenderer({ ...params, items: filteredMyGroups })
256+
}
257+
/>
258+
)}
259+
</AutoSizer>
260+
)}
258261
{myGroups.filter((g) =>
259262
g.name.toLowerCase().includes(filter.toLowerCase())
260263
).length === 0 &&
@@ -264,22 +267,26 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
264267
<h3 className={style.subTitle}>
265268
Other Groups{loadingGroups && " (Loading...)"}
266269
</h3>
267-
<div>
270+
<div className={style.clear}>
268271
{!loadingGroups && (
269-
<List
270-
className={style.groupsList}
271-
width={listWidth}
272-
height={
273-
filteredOtherGroups.length > 10
274-
? 450
275-
: filteredOtherGroups.length * 45
276-
}
277-
rowCount={filteredOtherGroups.length}
278-
rowHeight={45}
279-
rowRenderer={(params) =>
280-
rowRenderer({ ...params, items: filteredOtherGroups })
281-
}
282-
/>
272+
<AutoSizer disableHeight>
273+
{() => (
274+
<List
275+
className={style.groupsList}
276+
width={listWidth + 20}
277+
height={
278+
filteredOtherGroups.length > 10
279+
? 250
280+
: filteredOtherGroups.length * 45
281+
}
282+
rowCount={filteredOtherGroups.length}
283+
rowHeight={45}
284+
rowRenderer={(params) =>
285+
rowRenderer({ ...params, items: filteredOtherGroups })
286+
}
287+
/>
288+
)}
289+
</AutoSizer>
283290
)}
284291
</div>
285292
{otherGroups.filter((g) =>

client/src/components/AddToGroupModal/style.module.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
.searchRow {
7979
display: flex;
8080
position: relative;
81-
margin: 0 30px;
81+
margin: 0 10px;
8282
}
8383

8484
.subTitle {
@@ -123,3 +123,8 @@
123123
visibility: hidden;
124124
}
125125
}
126+
127+
.clear {
128+
padding-right: 15px;
129+
overflow: auto;
130+
}

client/src/components/Modal/style.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
max-width: $screen-md;
2828
overflow: hidden;
2929
padding: 30px;
30-
min-width: 500px;
30+
min-width: 520px;
3131
position: fixed;
3232
top: 50%;
3333
left: 50%;

0 commit comments

Comments
 (0)