Skip to content

Commit 6aa2171

Browse files
samir0607dougfabriskodiakhq[bot]
authored
fix: Composer Popup doesn't scroll results (#35468)
Co-authored-by: dougfabris <devfabris@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 7f97483 commit 6aa2171

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

.changeset/calm-jobs-relax.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Fixes an issue where the composer popup doesn't scroll the results properly

apps/meteor/client/views/room/composer/ComposerBoxPopup.tsx

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import type { ReactElement } from 'react';
55
import { useEffect, memo, useMemo, useRef, useId } from 'react';
66
import { useTranslation } from 'react-i18next';
77

8+
import { CustomScrollbars } from '../../../components/CustomScrollbars';
9+
810
export type ComposerBoxPopupProps<
911
T extends {
1012
_id: string;
@@ -91,26 +93,28 @@ function ComposerBoxPopup<
9193
{title}
9294
</Box>
9395
)}
94-
<Box pb={8} maxHeight='x320'>
95-
{!isLoading && itemsFlat.length === 0 && <Option>{t('No_results_found')}</Option>}
96-
{isLoading && <OptionSkeleton />}
97-
{itemsFlat.map((item, index) => {
98-
return (
99-
<Option
100-
title={getOptionTitle(item)}
101-
onClick={() => select(item)}
102-
selected={item === focused}
103-
key={index}
104-
id={`popup-item-${item._id}`}
105-
tabIndex={item === focused ? 0 : -1}
106-
aria-selected={item === focused}
107-
disabled={item.disabled}
108-
>
109-
{renderItem({ item: { ...item, variant } })}
110-
</Option>
111-
);
112-
})}
113-
</Box>
96+
<CustomScrollbars>
97+
<Box pb={8} maxHeight='x320'>
98+
{!isLoading && itemsFlat.length === 0 && <Option>{t('No_results_found')}</Option>}
99+
{isLoading && <OptionSkeleton />}
100+
{itemsFlat.map((item, index) => {
101+
return (
102+
<Option
103+
title={getOptionTitle(item)}
104+
onClick={() => select(item)}
105+
selected={item === focused}
106+
key={index}
107+
id={`popup-item-${item._id}`}
108+
tabIndex={item === focused ? 0 : -1}
109+
aria-selected={item === focused}
110+
disabled={item.disabled}
111+
>
112+
{renderItem({ item: { ...item, variant } })}
113+
</Option>
114+
);
115+
})}
116+
</Box>
117+
</CustomScrollbars>
114118
</Tile>
115119
</Box>
116120
);

0 commit comments

Comments
 (0)