Skip to content

Commit 48f1318

Browse files
fix overflow of file item
1 parent 7ffda11 commit 48f1318

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/ui/src/components/file-explorer.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,17 @@ function FolderItem({ children, value = '', isActive, content, link, level }: Fo
108108
)
109109
}
110110

111-
interface FileItemProps {
111+
type FileItemProps = {
112112
level: number
113113
children: ReactNode
114114
isActive?: boolean
115115
link?: string
116116
onClick?: () => void
117117
tooltip?: TooltipProps['content']
118+
[key: `data-${string}`]: any
118119
}
119120

120-
function FileItem({ children, isActive, level, link, onClick, tooltip }: FileItemProps) {
121+
function FileItem({ children, isActive, level, link, onClick, tooltip, ...dataProps }: FileItemProps) {
121122
const comp = (
122123
<Item
123124
icon="empty-page"
@@ -126,6 +127,7 @@ function FileItem({ children, isActive, level, link, onClick, tooltip }: FileIte
126127
style={{ marginLeft: `calc(-16px * ${level})`, paddingLeft: level ? `calc(16px * ${level} + 8px)` : '24px' }}
127128
onClick={onClick}
128129
link={link}
130+
{...dataProps}
129131
>
130132
{children}
131133
</Item>

packages/ui/src/views/repo/pull-request/details/components/changes/pull-request-changes-explorer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,9 @@ function renderTree(
359359
)}
360360
</Layout.Flex>
361361
}
362+
data-explorer-path={node.path}
362363
>
363-
<div data-explorer-path={node.path}>{node.name}</div>
364+
{node.name}
364365
</FileExplorer.FileItem>
365366
)
366367
}

0 commit comments

Comments
 (0)