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