Skip to content

Commit

Permalink
Fix context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
longern committed Sep 3, 2024
1 parent a3d2e06 commit 401ba35
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/FileGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ function FileGrid({
{files.map((file) => (
<Grid item key={file.key} xs={12} sm={6} md={4} lg={3} xl={2}>
<ListItemButton
component="a"
href={`/webdav/${encodeKey(file.key)}`}
target="_blank"
rel="noopener noreferrer"
selected={multiSelected?.includes(file.key)}
onClick={(event) => {
onClick={() => {
if (multiSelected !== null) {
onMultiSelect(file.key);
event.preventDefault();
} else if (isDirectory(file)) {
onCwdChange(file.key + "/");
event.preventDefault();
}
} else
window.open(
`/webdav/${encodeKey(file.key)}`,
"_blank",
"noopener,noreferrer"
);
}}
onContextMenu={(e) => {
e.preventDefault();
onMultiSelect(file.key);
}}
sx={{ userSelect: "none" }}
>
<ListItemIcon>
{file.customMetadata?.thumbnail ? (
Expand Down

0 comments on commit 401ba35

Please sign in to comment.