fix: selecting state

This commit is contained in:
Stephen Zhou 2024-11-11 11:53:29 +08:00
parent 6b8572c37a
commit 146fe8fa5c
No known key found for this signature in database
1 changed files with 6 additions and 1 deletions

View File

@ -60,6 +60,7 @@ const FeedItemImpl = ({ view, feedId, className }: FeedItemProps) => {
const [selectedFeedIds, setSelectedFeedIds] = useSelectedFeedIds()
const draggableContext = useContext(DraggableContext)
const isInMultipleSelection = selectedFeedIds.includes(feedId)
const isMultiSelectingButNotSelected = selectedFeedIds.length > 0 && !isInMultipleSelection
const handleClick: React.MouseEventHandler<HTMLDivElement> = useCallback(
(e) => {
@ -111,7 +112,11 @@ const FeedItemImpl = ({ view, feedId, className }: FeedItemProps) => {
: {})}
style={isInMultipleSelection ? draggableContext?.style : undefined}
data-feed-id={feedId}
data-active={isActive || isContextMenuOpen || isInMultipleSelection}
data-active={
isMultiSelectingButNotSelected
? false
: isActive || isContextMenuOpen || isInMultipleSelection
}
className={cn(
"flex w-full cursor-menu items-center justify-between rounded-md py-[2px] pr-2.5 text-sm font-medium leading-loose",
feedColumnStyles.item,