Skip to content

Commit

Permalink
move add/filter buttons outside tree's tab order (#6510)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Whitten <[email protected]>
  • Loading branch information
beyackle and cwhitten authored Mar 31, 2021
1 parent 07f037c commit 447fa7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,13 @@ export const ProjectTree: React.FC<Props> = ({
data-testid="ProjectTree"
role="region"
>
<ProjectTreeHeader
ariaLabel={headerAriaLabel}
menu={headerMenu}
placeholder={headerPlaceholder}
onFilter={onFilter}
/>
<FocusZone isCircularNavigation css={focusStyle} direction={FocusZoneDirection.vertical}>
<ProjectTreeHeader
ariaLabel={headerAriaLabel}
menu={headerMenu}
placeholder={headerPlaceholder}
onFilter={onFilter}
/>
<div
aria-label={formatMessage(
`{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const commands = css`
box-sizing: border-box;
justify-content: space-between;
display: flex;
flex-direction: row-reverse;
flex-direction: row;
`;

export interface ProjectTreeHeaderMenuItem {
Expand Down Expand Up @@ -105,13 +105,6 @@ export const ProjectTreeHeader: React.FC<ProjectTreeHeaderProps> = ({
/>
) : (
<div css={commands}>
<CommandButton
css={buttonStyle}
iconProps={{ iconName: 'Filter' }}
onClick={() => {
setShowFilter(true);
}}
/>
{overflowMenu.length ? (
<CommandButton
data-is-focusable
Expand All @@ -121,6 +114,7 @@ export const ProjectTreeHeader: React.FC<ProjectTreeHeaderProps> = ({
data-testid="projectTreeHeaderMoreButton"
iconProps={{ iconName: 'Add' }}
menuProps={{ items: overflowMenu }}
tabIndex={0}
text={formatMessage('Add')}
onKeyDown={(e) => {
if (e.key === 'Enter') {
Expand All @@ -129,6 +123,14 @@ export const ProjectTreeHeader: React.FC<ProjectTreeHeaderProps> = ({
}}
/>
) : null}
<CommandButton
css={buttonStyle}
iconProps={{ iconName: 'Filter' }}
tabIndex={0}
onClick={() => {
setShowFilter(true);
}}
/>
</div>
)}
</div>
Expand Down

0 comments on commit 447fa7b

Please sign in to comment.