Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3154,6 +3154,9 @@ Map {
"onChange": Object {
"type": "func",
},
"onInputValueChange": Object {
"type": "func",
},
"onMenuChange": Object {
"type": "func",
},
Expand Down Expand Up @@ -4339,6 +4342,9 @@ Map {
"onChange": Object {
"type": "func",
},
"onInputValueChange": Object {
"type": "func",
},
"onMenuChange": Object {
"type": "func",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ export default class FilterableMultiSelect extends React.Component {
*/
onChange: PropTypes.func,

/**
* `onInputValueChange` is a utility for this controlled component to communicate to
* the currently typed input.
*/
onInputValueChange: PropTypes.func,

/**
* `onMenuChange` is a utility for this controlled component to communicate to a
* consuming component that the menu was opened(`true`)/closed(`false`).
Expand Down Expand Up @@ -259,6 +265,10 @@ export default class FilterableMultiSelect extends React.Component {
};

handleOnInputValueChange = (inputValue, { type }) => {
if (this.props.onInputValueChange) {
this.props.onInputValueChange(inputValue, { type });
}

if (type !== Downshift.stateChangeTypes.changeInput) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect(
itemToString,
light,
locale,
onInputValueChange,
open,
onChange,
onMenuChange,
Expand Down Expand Up @@ -165,6 +166,10 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect(
}

function handleOnInputValueChange(inputValue, { type }) {
if (onInputValueChange) {
onInputValueChange(inputValue, { type });
}

if (type !== Downshift.stateChangeTypes.changeInput) {
return;
}
Expand Down Expand Up @@ -515,6 +520,12 @@ FilterableMultiSelect.propTypes = {
*/
onChange: PropTypes.func,

/**
* `onInputValueChange` is a utility for this controlled component to communicate to
* the currently typed input.
*/
onInputValueChange: PropTypes.func,

/**
* `onMenuChange` is a utility for this controlled component to communicate to a
* consuming component that the menu was opened(`true`)/closed(`false`).
Expand Down