|
|
|
@ -58,16 +58,8 @@ class Dropdown extends React.PureComponent {
|
|
|
|
|
userInputtedValue = ''
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
innerRef,
|
|
|
|
|
color,
|
|
|
|
|
selected,
|
|
|
|
|
onChange,
|
|
|
|
|
itemWrapper,
|
|
|
|
|
icon,
|
|
|
|
|
disableInput,
|
|
|
|
|
title,
|
|
|
|
|
} = this.props
|
|
|
|
|
const { innerRef, color, selected, onChange, itemWrapper, icon, disableInput, title } =
|
|
|
|
|
this.props
|
|
|
|
|
const { itemsToShow, inputValue } = this.state
|
|
|
|
|
|
|
|
|
|
const labelId = title ? `${title.toLowerCase()}-dropdown` : undefined
|
|
|
|
@ -98,7 +90,9 @@ class Dropdown extends React.PureComponent {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const renderDropdown = ({ color, list, itemWrapper, icon, disableInput, title, labelId }) => ({
|
|
|
|
|
const renderDropdown =
|
|
|
|
|
({ color, list, itemWrapper, icon, disableInput, title, labelId }) =>
|
|
|
|
|
({
|
|
|
|
|
isOpen,
|
|
|
|
|
highlightedIndex,
|
|
|
|
|
selectedItem,
|
|
|
|
@ -106,7 +100,7 @@ const renderDropdown = ({ color, list, itemWrapper, icon, disableInput, title, l
|
|
|
|
|
getToggleButtonProps,
|
|
|
|
|
getInputProps,
|
|
|
|
|
getItemProps,
|
|
|
|
|
}) => {
|
|
|
|
|
}) => {
|
|
|
|
|
return (
|
|
|
|
|
<DropdownContainer {...getRootProps({ refKey: 'innerRef' })}>
|
|
|
|
|
{title && <VisuallyHidden id={labelId}>{title}</VisuallyHidden>}
|
|
|
|
@ -142,7 +136,7 @@ const renderDropdown = ({ color, list, itemWrapper, icon, disableInput, title, l
|
|
|
|
|
) : null}
|
|
|
|
|
</DropdownContainer>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const DropdownContainer = ({ children, innerRef, ...rest }) => {
|
|
|
|
|
return (
|
|
|
|
|