Skip to content

Commit

Permalink
feat(fuselage): Add renderItem prop to the PaginatedMultiSelect c…
Browse files Browse the repository at this point in the history
…omponent (#1203)

Co-authored-by: Douglas Fabris <[email protected]>
  • Loading branch information
aleksandernsilva and dougfabris authored Oct 19, 2023
1 parent 5720081 commit da8cf6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-yaks-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/fuselage": minor
---

feat(fuselage): Add `renderItem` prop to the `PaginatedMultiSelect` component
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Chip from '../Chip';
import Flex from '../Flex';
import { Icon } from '../Icon';
import Margins from '../Margins';
import Option from '../Option';
import { useVisible } from '../Options/useVisible';
import { OptionsPaginated } from '../OptionsPaginated';
import Position from '../Position';
Expand All @@ -41,6 +42,7 @@ type PaginatedMultiSelectProps = Omit<
renderOptions?: (
props: ComponentProps<typeof OptionsPaginated>
) => ReactElement | null;
renderItem?: (props: ComponentProps<typeof Option>) => ReactElement | null;
anchor?: any;
};

Expand All @@ -55,6 +57,7 @@ const PaginatedMultiSelect = ({
onChange = () => {},
placeholder,
renderOptions: OptionsComponent = OptionsPaginated,
renderItem = Option,
endReached,
...props
}: PaginatedMultiSelectProps) => {
Expand Down Expand Up @@ -191,6 +194,7 @@ const PaginatedMultiSelect = ({
options={options}
cursor={-1}
endReached={endReached}
renderItem={renderItem}
onSelect={([value]) => {
toggleOption(value);
}}
Expand Down

0 comments on commit da8cf6a

Please sign in to comment.