Skip to content

Commit

Permalink
fix: amend logic of optional open item on checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
liuycy committed Feb 29, 2024
1 parent 25c4de8 commit a9ca814
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/pages/home/folder/GridItem.tsx
Expand Up @@ -62,8 +62,7 @@ export const GridItem = (props: { obj: StoreObj; index: number }) => {
on:click={(e: MouseEvent) => {
if (!checkboxOpen()) return
e.preventDefault()
if (e.altKey) {
// click with alt/option key
if (isShouldOpenItem()) {
to(pushHref(props.obj.name))
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/folder/ImageItem.tsx
Expand Up @@ -87,7 +87,7 @@ export const ImageItem = (props: { obj: StoreObj; index: number }) => {
!checkboxOpen() || isShouldOpenItem() ? "pointer" : "default"
}
on:click={(e: MouseEvent) => {
if (!checkboxOpen() || e.altKey) {
if (!checkboxOpen() || isShouldOpenItem()) {
bus.emit("gallery", props.obj.name)
return
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/home/folder/ListItem.tsx
Expand Up @@ -65,7 +65,6 @@ export const ListItem = (props: { obj: StoreObj; index: number }) => {
if (!checkboxOpen()) return
e.preventDefault()
if (isShouldOpenItem()) {
// click with alt/option key
to(pushHref(props.obj.name))
return
}
Expand Down

0 comments on commit a9ca814

Please sign in to comment.