Skip to content

Commit b433694

Browse files
committed
fix(filelist): make the row name link fill the cell height
1 parent d51f9f1 commit b433694

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/modules/filelist/FileOpener.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import cx from 'classnames'
12
import React, { useRef } from 'react'
23

34
import styles from './fileopener.styl'
@@ -12,6 +13,7 @@ const FileOpener = ({
1213
disabled,
1314
isRenaming,
1415
onInteractWithFile,
16+
fillHeight,
1517
children
1618
}) => {
1719
const rowRef = useRef()
@@ -33,7 +35,9 @@ const FileOpener = ({
3335
<FileLink
3436
ref={rowRef}
3537
link={link}
36-
className={`${styles['file-opener']} ${styles['file-opener__a']}`}
38+
className={cx(styles['file-opener'], styles['file-opener__a'], {
39+
[styles['file-opener--fill-height']]: fillHeight
40+
})}
3741
{...handlers}
3842
>
3943
{children}

src/modules/filelist/fileopener.styl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@
1212
.file-opener__a
1313
text-decoration none
1414
color var(--secondaryTextColor)
15+
16+
// Make the link fill its cell so the whole row height (not just the
17+
// vertically-centered text) opens the file on double-click.
18+
.file-opener--fill-height
19+
display flex
20+
align-items center
21+
width 100%
22+
height 100%

src/modules/filelist/virtualized/cells/columns/NameCell.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const NameCell = ({
5050
toggle={toggle}
5151
isRenaming={isRenaming}
5252
onInteractWithFile={onInteractWithFile}
53+
fillHeight
5354
>
5455
<FileName
5556
attributes={row}

0 commit comments

Comments
 (0)