Skip to content

Commit

Permalink
add role, name, posinset for paste in edgeMenu (#2126)
Browse files Browse the repository at this point in the history
Co-authored-by: zeye <2295905420@qq.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
  • Loading branch information
3 people committed Mar 4, 2020
1 parent a20d2b2 commit 7191c2f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@ const buildEdgeMenuItemsFromClipboardContext = (
);

const enablePaste = Array.isArray(clipboardActions) && clipboardActions.length > 0;
const menuItemCount = menuItems.length;
menuItems.unshift(
{
key: 'Paste',
name: 'Paste',
ariaLabel: 'Paste',
disabled: !enablePaste,
onRender: () => {
return (
<button
disabled={!enablePaste}
role="menuitem"
name="Paste"
aria-posinset={1}
aria-setsize={menuItemCount + 1}
css={css`
color: ${enablePaste ? '#0078D4' : '#BDBDBD'};
background: #fff;
Expand Down

0 comments on commit 7191c2f

Please sign in to comment.