mirror of https://github.com/buster-so/buster.git
hover should trigger selected, not hover
This commit is contained in:
parent
c2416889ba
commit
dfc17043fb
|
@ -13,7 +13,8 @@ export function MentionListItem<T = string>({
|
||||||
disabled,
|
disabled,
|
||||||
onSelectItem,
|
onSelectItem,
|
||||||
secondaryContent,
|
secondaryContent,
|
||||||
}: Omit<MentionTriggerItemExtended<T>, 'setSelectedItem'>) {
|
setSelectedItem,
|
||||||
|
}: MentionTriggerItemExtended<T>) {
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
const listRef = useMentionListRef();
|
const listRef = useMentionListRef();
|
||||||
|
|
||||||
|
@ -39,9 +40,9 @@ export function MentionListItem<T = string>({
|
||||||
'group/mention-list-item',
|
'group/mention-list-item',
|
||||||
'flex items-center justify-between gap-x-1.5 overflow-hidden',
|
'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`,
|
`cursor-pointer px-2.5 min-h-8 text-base rounded transition-all duration-100`,
|
||||||
'hover:bg-item-hover',
|
'data-[selected=true]:bg-item-hover'
|
||||||
isSelected && 'bg-item-hover'
|
|
||||||
)}
|
)}
|
||||||
|
onMouseEnter={() => setSelectedItem(value)}
|
||||||
>
|
>
|
||||||
<div className="flex items-center space-x-2 overflow-hidden">
|
<div className="flex items-center space-x-2 overflow-hidden">
|
||||||
{icon && <span className="text-icon-color">{icon}</span>}
|
{icon && <span className="text-icon-color">{icon}</span>}
|
||||||
|
|
|
@ -40,6 +40,7 @@ export function MentionListSelector<T = string>(props: MentionInputTriggerItemEx
|
||||||
}
|
}
|
||||||
|
|
||||||
const _exhaustiveCheck: never = type;
|
const _exhaustiveCheck: never = type;
|
||||||
|
console.warn('mention list selector type not found', _exhaustiveCheck);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue