Skip to content

Commit

Permalink
Added focus styles for single options
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-bongiovanni committed Jul 10, 2023
1 parent 23602fd commit 3c65c91
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/components/SelectInput/SelectInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const messages = defineMessages({
'premi la freccia a sinistra per evidenziare i valori selezionati',
},
ay11_toggle_values: {
id: 'ay11_select_Use left and right to toggle between focused values, press Backspace to remove the currently focused value',
id:
'ay11_select_Use left and right to toggle between focused values, press Backspace to remove the currently focused value',
defaultMessage:
'Usa le frecce destra e sinistra per attivare o disattivare i valori evidenziati, premi Backspace per rimuovere il valore corrente evidenziato',
},
Expand Down Expand Up @@ -176,8 +177,13 @@ ClearIndicator.propTypes = {
const getSelectAriaLiveMessages = (intl) => {
return {
guidance: (props) => {
const { isSearchable, isMulti, isDisabled, tabSelectsValue, context } =
props;
const {
isSearchable,
isMulti,
isDisabled,
tabSelectsValue,
context,
} = props;
switch (context) {
case 'menu':
return `${intl.formatMessage(messages.ay11_up_down)}${
Expand Down Expand Up @@ -338,6 +344,16 @@ const SelectInput = ({
}`
}
classNamePrefix={'react-select'}
styles={{
option: (base) => ({
...base,
':focus': {
'border-color': 'hsl(36deg, 100%, 50%) !important',
'box-shadow': '0 0 0 2px hsl(36deg, 100%, 50%) !important',
outline: 'none !important',
},
}),
}}
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/theme/_cms-ui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ body.cms-ui {

.react-select__menu {
z-index: 11;

/* FIX CT SELECT REACTVIRTUALIZED */
.ReactVirtualized__Grid.ReactVirtualized__List {
width: 100% !important;
Expand Down

0 comments on commit 3c65c91

Please sign in to comment.