hover should trigger selected, not hover

This commit is contained in:
Nate Kelley 2025-10-01 09:42:33 -06:00
parent c2416889ba
commit dfc17043fb
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,8 @@ export function MentionListItem<T = string>({
disabled,
onSelectItem,
secondaryContent,
}: Omit<MentionTriggerItemExtended<T>, 'setSelectedItem'>) {
setSelectedItem,
}: MentionTriggerItemExtended<T>) {
const containerRef = useRef<HTMLDivElement>(null);
const listRef = useMentionListRef();
@ -39,9 +40,9 @@ export function MentionListItem<T = string>({
'group/mention-list-item',
'flex items-center justify-between gap-x-1.5 overflow-hidden',
`cursor-pointer px-2.5 min-h-8 text-base rounded transition-all duration-100`,
'hover:bg-item-hover',
isSelected && 'bg-item-hover'
'data-[selected=true]:bg-item-hover'
)}
onMouseEnter={() => setSelectedItem(value)}
>
<div className="flex items-center space-x-2 overflow-hidden">
{icon && <span className="text-icon-color">{icon}</span>}

View File

@ -40,6 +40,7 @@ export function MentionListSelector<T = string>(props: MentionInputTriggerItemEx
}
const _exhaustiveCheck: never = type;
console.warn('mention list selector type not found', _exhaustiveCheck);
return null;
}