Skip to content

Commit

Permalink
WIP selectInput
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-bongiovanni committed Sep 19, 2023
1 parent 9e8579b commit 9bd1206
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/ItaliaTheme/Search/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,14 @@ const Search = () => {
sortOnOptions.filter((o) => o.value === sortOn)[0]
}
label={intl.formatMessage(messages.orderBy)}
placeholder={intl.formatMessage(messages.orderBy)}
placeholder={
sortOnOptions.find((o) => o.value === sortOn).label
}
onChange={(opt) => setSortOn(opt.value)}
options={sortOnOptions}
defaultValue={sortOnOptions.find(
(o) => o.value === 'relevance',
)}
/>
</Col>
</Row>
Expand Down
6 changes: 5 additions & 1 deletion src/components/SelectInput/SelectInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ const SelectInput = ({
options,
components = {},
reactSelect,
defaultValue,
}) => {
const intl = useIntl();
const Select = reactSelect.default;
Expand Down Expand Up @@ -332,7 +333,9 @@ const SelectInput = ({
isSearchable={isSearchable}
isMulti={isMulti}
isClearable={isClearable}
aria-label={placeholder}
aria-label={label}
aria-live="polite"
aria-labelledby={id}
ariaLiveMessages={getSelectAriaLiveMessages(intl)}
noOptionsMessage={() =>
intl.formatMessage(messages.select_noOptionsMessage)
Expand All @@ -346,6 +349,7 @@ const SelectInput = ({
}`
}
classNamePrefix={'react-select'}
defaultValue={defaultValue}
/>
</div>
);
Expand Down

0 comments on commit 9bd1206

Please sign in to comment.