Browse Source

SONAR-20177 Fix Checkbox + Spinner implementation

tags/10.3.0.82913
Viktor Vorona 7 months ago
parent
commit
654eb453d5
1 changed files with 13 additions and 12 deletions
  1. 13
    12
      server/sonar-web/design-system/src/components/input/Checkbox.tsx

+ 13
- 12
server/sonar-web/design-system/src/components/input/Checkbox.tsx View File

@@ -76,12 +76,13 @@ export function Checkbox({
onFocus={onFocus}
type="checkbox"
/>
{!loading && (
<StyledCheckbox aria-hidden data-clickable="true" title={title}>
<CheckboxIcon checked={checked} thirdState={thirdState} />
</StyledCheckbox>
)}
<Spinner loading={loading} />
<div>
<Spinner loading={loading}>
<StyledCheckbox aria-hidden data-clickable="true" title={title}>
<CheckboxIcon checked={checked} thirdState={thirdState} />
</StyledCheckbox>
</Spinner>
</div>
{!right && children}
</CheckboxContainer>
);
@@ -145,33 +146,33 @@ export const AccessibleCheckbox = styled.input`

&:focus,
&:active {
&:not(:disabled) + ${StyledCheckbox} {
&:not(:disabled) + div > ${StyledCheckbox} {
outline: ${themeBorder('focus', 'primary')};
}
}

&:checked {
& + ${StyledCheckbox} {
& + div > ${StyledCheckbox} {
background: ${themeColor('primary')};
}
&:disabled + ${StyledCheckbox} {
&:disabled + div > ${StyledCheckbox} {
background: ${themeColor('checkboxDisabledChecked')};
}
}

&:hover {
&:not(:disabled) + ${StyledCheckbox} {
&:not(:disabled) + div > ${StyledCheckbox} {
background: ${themeColor('checkboxHover')};
border: ${themeBorder('default', 'primary')};
}

&:checked:not(:disabled) + ${StyledCheckbox} {
&:checked:not(:disabled) + div > ${StyledCheckbox} {
background: ${themeColor('checkboxCheckedHover')};
border: ${themeBorder('default', 'checkboxCheckedHover')};
}
}

&:disabled + ${StyledCheckbox} {
&:disabled + div > ${StyledCheckbox} {
background: ${themeColor('checkboxDisabled')};
color: ${themeColor('checkboxDisabled')};
border: ${themeBorder('default', 'checkboxDisabledChecked')};

Loading…
Cancel
Save