mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-05 09:13:28 +00:00
Merge pull request #566 from JulesGuesnon/fix/file-unhighlighting
This commit is contained in:
commit
808bc9f33a
|
@ -117,7 +117,13 @@ export const VirtualizedList = memo(({ data, context, onScroll }: Props) => {
|
|||
|
||||
return (
|
||||
<div style={{ marginTop: -TOP_BAR_HEIGHT }} className="w-full pl-2 cursor-default">
|
||||
<div ref={scrollRef} className="h-screen custom-scroll explorer-scroll">
|
||||
<div
|
||||
ref={scrollRef}
|
||||
className="h-screen custom-scroll explorer-scroll"
|
||||
onClick={(e) => {
|
||||
getExplorerStore().selectedRowIndex = -1;
|
||||
}}
|
||||
>
|
||||
<div
|
||||
ref={innerRef}
|
||||
style={{
|
||||
|
@ -186,9 +192,14 @@ const WrappedItem = memo(({ item, index, isSelected, kind }: WrappedItemProps) =
|
|||
if (isPath(item) && item.item.is_dir) setSearchParams({ path: item.item.materialized_path });
|
||||
}, [item, setSearchParams]);
|
||||
|
||||
const onClick = useCallback(() => {
|
||||
getExplorerStore().selectedRowIndex = isSelected ? -1 : index;
|
||||
}, [isSelected, index]);
|
||||
const onClick = useCallback(
|
||||
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||
e.stopPropagation();
|
||||
|
||||
getExplorerStore().selectedRowIndex = isSelected ? -1 : index;
|
||||
},
|
||||
[isSelected, index]
|
||||
);
|
||||
|
||||
const ItemComponent = kind === 'list' ? FileRow : FileItem;
|
||||
|
||||
|
|
Loading…
Reference in a new issue