Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

fix(multi-select): introduce translateWithId #2175

Merged
merged 2 commits into from
Apr 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/MultiSelect/FilterableMultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export default class FilterableMultiSelect extends React.Component {
* Initialize the component with an open(`true`)/closed(`false`) menu.
*/
open: PropTypes.bool,

/**
* Callback function for translating ListBoxMenuIcon SVG title
*/
translateWithId: PropTypes.func,
};

static getDerivedStateFromProps({ open }, state) {
Expand Down Expand Up @@ -221,6 +226,7 @@ export default class FilterableMultiSelect extends React.Component {
light,
invalid,
invalidText,
translateWithId,
} = this.props;
const className = cx(
`${prefix}--multi-select`,
Expand Down Expand Up @@ -281,7 +287,10 @@ export default class FilterableMultiSelect extends React.Component {
{inputValue && isOpen && (
<ListBox.Selection clearSelection={this.clearInputValue} />
)}
<ListBox.MenuIcon isOpen={isOpen} />
<ListBox.MenuIcon
isOpen={isOpen}
translateWithId={translateWithId}
/>
</ListBox.Field>
{isOpen && (
<ListBox.Menu>
Expand Down