Skip to content

Commit e80539b

Browse files
committed
spacer should come before leadingAction
1 parent b3ab515 commit e80539b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/react/src/TreeView/TreeView.features.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ export const WithoutIndentation: Story = () => (
995995
export const WithLeadingAction: Story = () => {
996996
// todo: implement fold on click
997997
// todo: implement hide until hovered
998+
// todo: check if draggy boi should be aria-hidden
998999
const dragAction = <IconButton aria-label="Reorder item" variant="invisible" icon={GrabberIcon} />
9991000

10001001
return (

packages/react/src/TreeView/TreeView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const UlBox = styled.ul<SxProp>`
109109
display: grid;
110110
--leading-action-width: calc(var(--has-leading-action, 0) * 1.5rem);
111111
--spacer-width: calc(calc(var(--level) - 1) * (var(--toggle-width) / 2));
112-
grid-template-columns: var(--leading-action-width) var(--spacer-width) var(--toggle-width) 1fr;
113-
grid-template-areas: 'leadingAction spacer toggle content';
112+
grid-template-columns: var(--spacer-width) var(--leading-action-width) var(--toggle-width) 1fr;
113+
grid-template-areas: 'spacer leadingAction toggle content';
114114
width: 100%;
115115
min-height: 2rem; /* 32px */
116116
font-size: ${get('fontSizes.1')};
@@ -501,10 +501,10 @@ const Item = React.forwardRef<HTMLElement, TreeViewItemProps>(
501501
containIntrinsicSize,
502502
}}
503503
>
504-
{slots.leadingAction}
505504
<div style={{gridArea: 'spacer', display: 'flex'}}>
506505
<LevelIndicatorLines level={level} />
507506
</div>
507+
{slots.leadingAction}
508508
{hasSubTree ? (
509509
// This lint rule is disabled due to the guidelines in the `TreeView` api docs.
510510
// https://github.com/github/primer/blob/main/apis/tree-view-api.md#the-expandcollapse-chevron-toggle

0 commit comments

Comments
 (0)