diff --git a/components/transfer/src/options-container.js b/components/transfer/src/options-container.js
index ce3c60a55e..fec1ce21eb 100644
--- a/components/transfer/src/options-container.js
+++ b/components/transfer/src/options-container.js
@@ -12,10 +12,12 @@ export const OptionsContainer = ({
getOptionClickHandlers,
highlightedOptions,
loading,
+ maxSelections,
renderOption,
options,
selected,
selectionHandler,
+ setHighlightedOptions,
toggleHighlightedOption,
}) => {
const optionsRef = useRef(null)
@@ -31,51 +33,62 @@ export const OptionsContainer = ({
)}
-
- {!options.length && emptyComponent}
- {options.map((option) => {
- const highlighted = !!highlightedOptions.find(
- (highlightedSourceOption) =>
- highlightedSourceOption === option.value
- )
+ {!options.length && emptyComponent}
+ {!!options.length && (
+
+ return (
+
+ {renderOption({
+ ...option,
+ ...getOptionClickHandlers(
+ option,
+ selectionHandler,
+ toggleHighlightedOption
+ ),
+ highlighted,
+ selected,
+ })}
+
+ )
+ })}
+
+ )}
-
+ >
)
}
@@ -81,7 +61,6 @@ TransferOption.propTypes = {
className: PropTypes.string,
dataTest: PropTypes.string,
disabled: PropTypes.bool,
- highlighted: PropTypes.bool,
onClick: PropTypes.func,
onDoubleClick: PropTypes.func,
}
diff --git a/components/transfer/src/transfer.js b/components/transfer/src/transfer.js
index deca9a9f9f..1df39c9765 100644
--- a/components/transfer/src/transfer.js
+++ b/components/transfer/src/transfer.js
@@ -217,6 +217,8 @@ export const Transfer = ({
)}