Skip to content

Commit

Permalink
remove menu roles from overflowset and resizegroup examples (microsof…
Browse files Browse the repository at this point in the history
  • Loading branch information
smhigley authored and marwan38 committed Jun 13, 2022
1 parent 54df894 commit 46548d0
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const noOp = () => undefined;

const onRenderItem = (item: IOverflowSetItemProps): JSX.Element => {
return (
<Link role="menuitem" styles={{ root: { marginRight: 10 } }} onClick={item.onClick}>
<Link styles={{ root: { marginRight: 10 } }} onClick={item.onClick}>
{item.name}
</Link>
);
Expand All @@ -24,7 +24,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
};
return (
<IconButton
role="menuitem"
title="More options"
styles={buttonStyles}
menuIconProps={{ iconName: 'More' }}
Expand All @@ -36,7 +35,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
export const OverflowSetBasicExample: React.FunctionComponent = () => (
<OverflowSet
aria-label="Basic Menu Example"
role="menubar"
items={[
{
key: 'item1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const noOp = () => undefined;

const onRenderItem = (item: IOverflowSetItemProps): JSX.Element => {
return (
<Link role="menuitem" styles={{ root: { marginRight: 10 } }} onClick={item.onClick}>
<Link styles={{ root: { marginRight: 10 } }} onClick={item.onClick}>
{item.name}
</Link>
);
Expand All @@ -24,7 +24,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
};
return (
<IconButton
role="menuitem"
title="More options"
styles={buttonStyles}
menuIconProps={{ iconName: 'More' }}
Expand All @@ -36,7 +35,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
export const OverflowSetBasicReversedExample: React.FunctionComponent = () => (
<OverflowSet
aria-label="Basic Menu Example"
role="menubar"
items={[
{
key: 'item3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ const onRenderItem = (item: IOverflowSetItemProps): JSX.Element => {
if (item.onRender) {
return item.onRender(item);
}
return (
<CommandBarButton
role="menuitem"
iconProps={{ iconName: item.icon }}
menuProps={item.subMenuProps}
text={item.name}
/>
);
return <CommandBarButton iconProps={{ iconName: item.icon }} menuProps={item.subMenuProps} text={item.name} />;
};

const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element => {
Expand All @@ -36,7 +29,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
return (
<CommandBarButton
ariaLabel="More items"
role="menuitem"
styles={buttonStyles}
menuIconProps={{ iconName: 'More' }}
menuProps={{ items: overflowItems! }}
Expand All @@ -47,12 +39,11 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
export const OverflowSetCustomExample: React.FunctionComponent = () => (
<OverflowSet
aria-label="Custom Example"
role="menubar"
items={[
{
key: 'checkbox',
onRender: () => {
return <Checkbox inputProps={{ role: 'menuitemcheckbox' }} label="A Checkbox" styles={checkboxStyles} />;
return <Checkbox label="A Checkbox" styles={checkboxStyles} />;
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const onRenderItem = (item: IOverflowSetItemProps): JSX.Element => {
return (
<TooltipHost content={item.title} directionalHint={DirectionalHint.rightCenter}>
<CommandBarButton
role="menuitem"
aria-label={item.name}
styles={onRenderItemStyles}
iconProps={{ iconName: item.icon }}
Expand All @@ -31,7 +30,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
return (
<TooltipHost content="More items" directionalHint={DirectionalHint.rightCenter}>
<CommandBarButton
role="menuitem"
aria-label="More items"
styles={onRenderOverflowButtonStyles}
menuIconProps={{ iconName: 'More' }}
Expand All @@ -44,7 +42,6 @@ const onRenderOverflowButton = (overflowItems: any[] | undefined): JSX.Element =
export const OverflowSetVerticalExample: React.FunctionComponent = () => (
<OverflowSet
aria-label="Vertical Example"
role="menubar"
vertical
items={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const computeCacheKey = (primaryControls: IContextualMenuItem[]): string => {

const onRenderItem = (item: any) => (
<CommandBarButton
role="menuitem"
text={item.name}
iconProps={{ iconName: item.icon }}
onClick={item.onClick}
Expand Down Expand Up @@ -114,7 +113,6 @@ export const ResizeGroupOverflowSetExample: React.FunctionComponent = () => {
const onRenderData = (data: any) => {
return (
<OverflowSet
role="menubar"
items={data.primary}
overflowItems={data.overflow.length ? data.overflow : null}
onRenderItem={onRenderItem}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const dataToRender = generateData(20, false, false);

const onRenderItem = (item: any) => (
<CommandBarButton
role="menuitem"
text={item.name}
iconProps={{ iconName: item.icon }}
onClick={item.onClick}
Expand All @@ -62,7 +61,6 @@ const onRenderItem = (item: any) => (

const onRenderOverflowButton = (overflowItems: any) => (
<CommandBarButton
role="menuitem"
styles={buttonStyles}
menuIconProps={{ iconName: 'ChevronRight' }}
menuProps={{ items: overflowItems!, directionalHint: DirectionalHint.rightCenter }}
Expand All @@ -71,7 +69,6 @@ const onRenderOverflowButton = (overflowItems: any) => (

const onRenderData = (data: any) => (
<OverflowSet
role="menubar"
vertical
items={data.primary}
overflowItems={data.overflow.length ? data.overflow : null}
Expand Down

0 comments on commit 46548d0

Please sign in to comment.