mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-08 08:22:53 +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 (
|
return (
|
||||||
<div style={{ marginTop: -TOP_BAR_HEIGHT }} className="w-full pl-2 cursor-default">
|
<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
|
<div
|
||||||
ref={innerRef}
|
ref={innerRef}
|
||||||
style={{
|
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 });
|
if (isPath(item) && item.item.is_dir) setSearchParams({ path: item.item.materialized_path });
|
||||||
}, [item, setSearchParams]);
|
}, [item, setSearchParams]);
|
||||||
|
|
||||||
const onClick = useCallback(() => {
|
const onClick = useCallback(
|
||||||
getExplorerStore().selectedRowIndex = isSelected ? -1 : index;
|
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
}, [isSelected, index]);
|
e.stopPropagation();
|
||||||
|
|
||||||
|
getExplorerStore().selectedRowIndex = isSelected ? -1 : index;
|
||||||
|
},
|
||||||
|
[isSelected, index]
|
||||||
|
);
|
||||||
|
|
||||||
const ItemComponent = kind === 'list' ? FileRow : FileItem;
|
const ItemComponent = kind === 'list' ? FileRow : FileItem;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue