mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-08 07:12:49 +00:00
fix(Explorer): Added unhighlightning when clicking outside a file
This commit is contained in:
parent
5b78bbbb7d
commit
3a2e34664c
|
@ -117,7 +117,20 @@ 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) => {
|
||||||
|
if (
|
||||||
|
!scrollRef.current ||
|
||||||
|
(!(e.target as HTMLElement).classList.contains('file-row') &&
|
||||||
|
scrollRef.current !== e.target)
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
|
getExplorerStore().selectedRowIndex = -1;
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
ref={innerRef}
|
ref={innerRef}
|
||||||
style={{
|
style={{
|
||||||
|
@ -132,7 +145,7 @@ export const VirtualizedList = memo(({ data, context, onScroll }: Props) => {
|
||||||
height: `${virtualRow.size}px`,
|
height: `${virtualRow.size}px`,
|
||||||
transform: `translateY(${virtualRow.start}px)`
|
transform: `translateY(${virtualRow.start}px)`
|
||||||
}}
|
}}
|
||||||
className="absolute top-0 left-0 flex w-full"
|
className="file-row absolute top-0 left-0 flex w-full"
|
||||||
key={virtualRow.key}
|
key={virtualRow.key}
|
||||||
>
|
>
|
||||||
{explorerStore.layoutMode === 'list' ? (
|
{explorerStore.layoutMode === 'list' ? (
|
||||||
|
|
Loading…
Reference in a new issue