Skip to content

Commit

Permalink
fix(MultiSelect): add back downshift props
Browse files Browse the repository at this point in the history
  • Loading branch information
awarrier99 committed Feb 23, 2023
1 parent 51fb3ee commit 6c8f4bd
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 3 deletions.
122 changes: 121 additions & 1 deletion packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4820,7 +4820,127 @@ Map {
"type": "bool",
},
"downshiftProps": Object {
"type": "object",
"args": Array [
Object {
"children": Object {
"type": "func",
},
"defaultHighlightedIndex": Object {
"type": "number",
},
"defaultIsOpen": Object {
"type": "bool",
},
"environment": Object {
"args": Array [
Object {
"addEventListener": Object {
"type": "func",
},
"document": Object {
"args": Array [
Object {
"activeElement": Object {
"type": "any",
},
"body": Object {
"type": "any",
},
"getElementById": Object {
"type": "func",
},
},
],
"type": "shape",
},
"removeEventListener": Object {
"type": "func",
},
},
],
"type": "shape",
},
"getA11yStatusMessage": Object {
"type": "func",
},
"getItemId": Object {
"type": "func",
},
"highlightedIndex": Object {
"type": "number",
},
"id": Object {
"type": "string",
},
"initialHighlightedIndex": Object {
"type": "number",
},
"initialInputValue": Object {
"type": "string",
},
"initialIsOpen": Object {
"type": "bool",
},
"initialSelectedItem": Object {
"type": "any",
},
"inputId": Object {
"type": "string",
},
"inputValue": Object {
"type": "string",
},
"isOpen": Object {
"type": "bool",
},
"itemCount": Object {
"type": "number",
},
"itemToString": Object {
"type": "func",
},
"labelId": Object {
"type": "string",
},
"menuId": Object {
"type": "string",
},
"onChange": Object {
"type": "func",
},
"onInputValueChange": Object {
"type": "func",
},
"onOuterClick": Object {
"type": "func",
},
"onSelect": Object {
"type": "func",
},
"onStateChange": Object {
"type": "func",
},
"onUserAction": Object {
"type": "func",
},
"scrollIntoView": Object {
"type": "func",
},
"selectedItem": Object {
"type": "any",
},
"selectedItemChanged": Object {
"type": "func",
},
"stateReducer": Object {
"type": "func",
},
"suppressRefError": Object {
"type": "bool",
},
},
],
"type": "shape",
},
"helperText": Object {
"type": "node",
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
import cx from 'classnames';
import {
import Downshift, {
useSelect,
UseSelectInterface,
UseSelectProps,
Expand Down Expand Up @@ -654,7 +654,8 @@ MultiSelect.propTypes = {
/**
* Additional props passed to Downshift
*/
downshiftProps: PropTypes.object as React.Validator<UseSelectProps<unknown>>,
// @ts-ignore
downshiftProps: PropTypes.shape(Downshift.propTypes),

/**
* Provide helper text that is used alongside the control label for
Expand Down

0 comments on commit 6c8f4bd

Please sign in to comment.