diff --git a/.yarn/cache/caniuse-lite-npm-1.0.30001287-7c4995ce2e-b53c26a3a2.zip b/.yarn/cache/caniuse-lite-npm-1.0.30001287-7c4995ce2e-b53c26a3a2.zip deleted file mode 100644 index 36f4b17ab589..000000000000 Binary files a/.yarn/cache/caniuse-lite-npm-1.0.30001287-7c4995ce2e-b53c26a3a2.zip and /dev/null differ diff --git a/.yarn/cache/caniuse-lite-npm-1.0.30001359-a30b134aa2-e15dbf4ea4.zip b/.yarn/cache/caniuse-lite-npm-1.0.30001359-a30b134aa2-e15dbf4ea4.zip new file mode 100644 index 000000000000..299fa5fdc40e Binary files /dev/null and b/.yarn/cache/caniuse-lite-npm-1.0.30001359-a30b134aa2-e15dbf4ea4.zip differ diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index f060c6058b1f..7d3099aaab9a 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -3083,6 +3083,9 @@ Map { "onChange": Object { "type": "func", }, + "onInputValueChange": Object { + "type": "func", + }, "onMenuChange": Object { "type": "func", }, @@ -4160,6 +4163,9 @@ Map { "onChange": Object { "type": "func", }, + "onInputValueChange": Object { + "type": "func", + }, "onMenuChange": Object { "type": "func", }, diff --git a/packages/react/src/components/MultiSelect/FilterableMultiSelect.js b/packages/react/src/components/MultiSelect/FilterableMultiSelect.js index 199013039e14..7725d193819e 100644 --- a/packages/react/src/components/MultiSelect/FilterableMultiSelect.js +++ b/packages/react/src/components/MultiSelect/FilterableMultiSelect.js @@ -111,6 +111,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`). @@ -260,6 +266,10 @@ export default class FilterableMultiSelect extends React.Component { }; handleOnInputValueChange = (inputValue, { type }) => { + if (this.props.onInputValueChange) { + this.props.onInputValueChange(inputValue); + } + if (type !== Downshift.stateChangeTypes.changeInput) { return; } diff --git a/packages/react/src/components/MultiSelect/next/FilterableMultiSelect.js b/packages/react/src/components/MultiSelect/next/FilterableMultiSelect.js index 48959ff05680..2defe995fd0e 100644 --- a/packages/react/src/components/MultiSelect/next/FilterableMultiSelect.js +++ b/packages/react/src/components/MultiSelect/next/FilterableMultiSelect.js @@ -45,6 +45,7 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect( itemToString, light, locale, + onInputValueChange, open, onChange, onMenuChange, @@ -166,6 +167,10 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect( } function handleOnInputValueChange(inputValue, { type }) { + if (onInputValueChange) { + onInputValueChange(inputValue); + } + if (type !== Downshift.stateChangeTypes.changeInput) { return; } @@ -516,6 +521,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`). diff --git a/yarn.lock b/yarn.lock index 6119e10f4b73..c11d47e5129b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11591,9 +11591,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001125, caniuse-lite@npm:^1.0.30001179, caniuse-lite@npm:^1.0.30001202, caniuse-lite@npm:^1.0.30001219, caniuse-lite@npm:^1.0.30001228, caniuse-lite@npm:^1.0.30001272, caniuse-lite@npm:^1.0.30001286, caniuse-lite@npm:^1.0.30001287": - version: 1.0.30001287 - resolution: "caniuse-lite@npm:1.0.30001287" - checksum: b53c26a3a267a2920394e4aa5d1f60a76f891943914068066700e5497dda512f096d8a77dfefda17306a9df06e16ce9c6b5179f8856cc0efbcd8873d13b2fbea + version: 1.0.30001359 + resolution: "caniuse-lite@npm:1.0.30001359" + checksum: e15dbf4ea445367e998ad525c54620275ae382446d0bc289d14bf014a159074a2207881b46406b011a72676686f8a734457ea8e8d4856dc3f700c3391e89b43e languageName: node linkType: hard