diff --git a/src/components/ItaliaTheme/Search/Search.jsx b/src/components/ItaliaTheme/Search/Search.jsx index 3f92bd168..97507cdb5 100644 --- a/src/components/ItaliaTheme/Search/Search.jsx +++ b/src/components/ItaliaTheme/Search/Search.jsx @@ -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', + )} /> diff --git a/src/components/SelectInput/SelectInput.jsx b/src/components/SelectInput/SelectInput.jsx index 0e6837e0d..83ac3ca8f 100644 --- a/src/components/SelectInput/SelectInput.jsx +++ b/src/components/SelectInput/SelectInput.jsx @@ -305,6 +305,7 @@ const SelectInput = ({ options, components = {}, reactSelect, + defaultValue, }) => { const intl = useIntl(); const Select = reactSelect.default; @@ -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) @@ -346,6 +349,7 @@ const SelectInput = ({ }` } classNamePrefix={'react-select'} + defaultValue={defaultValue} /> );