Skip to content

Commit dca7090

Browse files
committed
Tiny bit more cleanup
1 parent 3d56f46 commit dca7090

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/packages/admin-ui-components/src/combo-box/component.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export const ComboBox = ({
9494
// Store the selected ids in a set for easy lookup - this is our source of truth for selection
9595
const selectedIds = useMemo(() => new Set(valueArray.map((item) => item.value)), [valueArray]);
9696

97-
9897
const sortOptionsBySelectedFirst = (opt1: SelectOption, opt2: SelectOption) => {
9998
return (selectedIds.has(opt2.value) ? 1 : 0) - (selectedIds.has(opt1.value) ? 1 : 0)
10099
}
@@ -362,7 +361,7 @@ export const ComboBox = ({
362361
) : (
363362
<>
364363
{
365-
// The sort function bumps any selected options to the top of the list.
364+
// Bump selected options to the top of the list.
366365
options.sort(sortOptionsBySelectedFirst).map((item, index) => {
367366
const isSelected = selectedIds.has(item.value);
368367
const testId = `${isSelected ? 'selected' : 'combo'}-option-${item.label}`

src/packages/admin-ui-components/src/combo-box/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
transition: background-color 0.2s ease;
254254
}
255255

256-
.selectedOptionHighlighted, .selectedOption:hover {
256+
.selectedOptionHighlighted {
257257
background-color: var(--color-red);
258258
}
259259

0 commit comments

Comments
 (0)