Skip to content

Commit 9a31529

Browse files
authored
Fix Select group label alignment (#1107)
1 parent c2f36c3 commit 9a31529

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343
- `FieldSelect`/`FieldSelectMulti` missing `aria-labelledby` attribute on the input
4444
- Major CSS linting clean-up
4545
- `CheckboxGroup` & `RadioGroup` options now properly wrap when the exceed the container width
46+
- `Select` & `SelectMulti` option group label alignment
4647

4748
### Removed
4849

packages/components/src/Form/Inputs/Combobox/ComboboxList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ const ComboboxUl = styled.ul<ComboboxListProps>`
240240
list-style-type: none;
241241
margin: 0;
242242
max-height: 30rem;
243+
outline: none;
243244
${layout}
244245
`
245246

packages/components/src/Form/Inputs/Combobox/ComboboxOptionIndicator.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ import {
4040
OptionContext,
4141
} from './ComboboxContext'
4242

43-
export type OptionIndicatorProps = ComboboxOptionStatuses & ComboboxOptionObject
43+
export type OptionIndicatorProps = Partial<ComboboxOptionStatuses> &
44+
ComboboxOptionObject
4445

4546
export type ComboboxOptionIndicatorFunction = (
4647
indicatorProps: OptionIndicatorProps
@@ -53,7 +54,7 @@ function isIndicatorFunction(
5354
}
5455

5556
export interface ComboboxOptionIndicatorProps
56-
extends ComboboxOptionStatuses,
57+
extends Partial<ComboboxOptionStatuses>,
5758
CompatibleHTMLProps<HTMLDivElement> {
5859
/**
5960
* Customize the area to the left of the label, which by default

packages/components/src/Form/Inputs/Select/SelectOptions.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
ComboboxMultiOption,
3535
ComboboxOption,
3636
ComboboxOptionIndicatorProps,
37+
ComboboxOptionIndicator,
3738
ComboboxOptionObject,
3839
ComboboxOptionText,
3940
} from '../Combobox'
@@ -109,6 +110,7 @@ export function SelectOptionWithDescription({
109110
}
110111

111112
const SelectOptionGroupTitle = styled(Heading)<{ isMulti?: boolean }>`
113+
display: flex;
112114
padding-top: ${({ theme }) => theme.space.xxsmall};
113115
`
114116

@@ -128,7 +130,7 @@ export const SelectOptionGroup = ({
128130
<SelectOptionGroupContainer>
129131
{label && (
130132
<SelectOptionGroupTitle isMulti={isMulti}>
131-
<span />
133+
<ComboboxOptionIndicator isMulti={isMulti} />
132134
{label}
133135
</SelectOptionGroupTitle>
134136
)}

0 commit comments

Comments
 (0)