Skip to content

Commit 0e84f22

Browse files
Add back isEnterCandidate styling but only when search input has a value
Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
1 parent 334f740 commit 0e84f22

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/components/src/ui/region-select.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export function RegionSelect({
127127
{filtered.length === 0 && <li className="px-3 py-2 text-sm text-gray-500">No results.</li>}
128128
{filtered.map((option) => {
129129
const isSelected = option.value === value;
130+
const isEnterCandidate = query.trim() !== '' && enterCandidate?.value === option.value && !isSelected;
130131
return (
131132
<li key={option.value} className="list-none">
132133
<button
@@ -141,6 +142,7 @@ export function RegionSelect({
141142
'w-full text-left cursor-pointer select-none py-3 px-3 transition-colors duration-150 flex items-center gap-2 rounded',
142143
'text-gray-900',
143144
isSelected ? 'bg-gray-100' : 'hover:bg-gray-100',
145+
isEnterCandidate && 'bg-gray-50',
144146
itemClassName
145147
)}
146148
>

0 commit comments

Comments
 (0)