Skip to content

Commit c97f84e

Browse files
authored
Fix ComboBox focus ring (#365)
* docs: propose updated theming approach * fix: update combobox to have correct focus outline
1 parent aedcfdc commit c97f84e

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

src/components/Common/UI/ComboBox/ComboBox.module.scss

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@
77
color: var(--g-typography-text-color);
88
width: 100%;
99
box-shadow: var(--g-shadow-100);
10-
11-
> div {
12-
position: relative;
13-
display: flex;
14-
align-items: center;
15-
border: var(--g-input-borderWidth) solid var(--g-input-borderColor);
16-
border-radius: var(--g-input-radius);
17-
background: var(--g-input-background);
18-
}
10+
position: relative;
11+
display: flex;
12+
align-items: center;
13+
border: var(--g-input-borderWidth) solid var(--g-input-borderColor);
14+
border-radius: var(--g-input-radius);
15+
background: var(--g-input-background);
1916

2017
&[data-invalid] {
21-
> div {
22-
border-color: var(--g-colors-error-500);
23-
}
18+
border-color: var(--g-colors-error-500);
2419
}
2520

2621
&:focus-within {
2722
@include formFocusOutline($offset: calc(var(--g-input-borderWidth) * -1));
28-
border-radius: var(--g-radius);
23+
border-radius: var(--g-input-radius);
24+
2925
&[data-invalid] {
3026
@include formFocusError($offset: calc(var(--g-input-borderWidth) * -1));
3127
}

src/components/Common/UI/ComboBox/ComboBox.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,13 @@ export const ComboBox = ({
7878
selectedKey={value ? (value as Key) : undefined}
7979
name={name}
8080
>
81-
<div>
82-
<Input ref={inputRef} placeholder={placeholder} onBlur={onBlur} {...props} />
83-
<Button>
84-
<div aria-hidden="true" className={styles.icons}>
85-
{isInvalid && <AlertCircle fontSize={16} />}
86-
<CaretDown title={t('icons.selectArrow')} />
87-
</div>
88-
</Button>
89-
</div>
81+
<Input ref={inputRef} placeholder={placeholder} onBlur={onBlur} {...props} />
82+
<Button>
83+
<div aria-hidden="true" className={styles.icons}>
84+
{isInvalid && <AlertCircle fontSize={16} />}
85+
<CaretDown title={t('icons.selectArrow')} />
86+
</div>
87+
</Button>
9088

9189
<Popover
9290
className={classNames(styles.popover, 'react-aria-Popover')}

0 commit comments

Comments
 (0)