From ba44811464ad762a4eba9df810788ddd4476e4c5 Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 3 Jan 2025 14:14:09 -0500 Subject: [PATCH] Fix #7045: MenuItem remove aria-hidden (#7562) --- components/lib/contextmenu/ContextMenuSub.js | 1 - components/lib/dock/Dock.js | 1 - components/lib/megamenu/MegaMenu.js | 3 +-- components/lib/menu/Menu.js | 1 - components/lib/menubar/MenubarSub.js | 1 - components/lib/panelmenu/PanelMenuSub.js | 3 +-- components/lib/tieredmenu/TieredMenuSub.js | 1 - 7 files changed, 2 insertions(+), 9 deletions(-) diff --git a/components/lib/contextmenu/ContextMenuSub.js b/components/lib/contextmenu/ContextMenuSub.js index 4e3ba66a73..0bf9ac5db6 100644 --- a/components/lib/contextmenu/ContextMenuSub.js +++ b/components/lib/contextmenu/ContextMenuSub.js @@ -222,7 +222,6 @@ export const ContextMenuSub = React.memo( const actionProps = mergeProps( { href: item.url || '#', - 'aria-hidden': true, tabIndex: -1, className: cx('action', { item }), target: item.target diff --git a/components/lib/dock/Dock.js b/components/lib/dock/Dock.js index 00d5e2de77..e60c8d18d9 100644 --- a/components/lib/dock/Dock.js +++ b/components/lib/dock/Dock.js @@ -193,7 +193,6 @@ export const Dock = React.memo( href: url || '#', onFocus: (event) => event.stopPropagation(), className: cx('action', { disabled }), - 'aria-hidden': 'true', tabIndex: -1, target, 'data-pr-tooltip': label, diff --git a/components/lib/megamenu/MegaMenu.js b/components/lib/megamenu/MegaMenu.js index 6a035b9fe6..49c7c71004 100644 --- a/components/lib/megamenu/MegaMenu.js +++ b/components/lib/megamenu/MegaMenu.js @@ -831,8 +831,7 @@ export const MegaMenu = React.memo( href: item.url || '#', className: cx('action', { item }), target: item.target, - tabIndex: '-1', - 'aria-hidden': true + tabIndex: '-1' }, getPTOptions(processedItem, 'action', index) ); diff --git a/components/lib/menu/Menu.js b/components/lib/menu/Menu.js index fb0d2373ee..aba8fb15de 100644 --- a/components/lib/menu/Menu.js +++ b/components/lib/menu/Menu.js @@ -370,7 +370,6 @@ export const Menu = React.memo( target: item.target, tabIndex: '-1', 'aria-label': item.label, - 'aria-hidden': true, 'aria-disabled': item.disabled, 'data-p-disabled': item.disabled }, diff --git a/components/lib/menubar/MenubarSub.js b/components/lib/menubar/MenubarSub.js index df86f1ee29..5d9f2a6909 100644 --- a/components/lib/menubar/MenubarSub.js +++ b/components/lib/menubar/MenubarSub.js @@ -193,7 +193,6 @@ export const MenubarSub = React.memo( { href: item.url || '#', tabIndex: '-1', - 'aria-hidden': 'true', className: cx('action', { disabled }), onFocus: (event) => event.stopPropagation(), target: getItemProp(processedItem, 'target'), diff --git a/components/lib/panelmenu/PanelMenuSub.js b/components/lib/panelmenu/PanelMenuSub.js index 3a85c42ae7..eaf1d0eab4 100644 --- a/components/lib/panelmenu/PanelMenuSub.js +++ b/components/lib/panelmenu/PanelMenuSub.js @@ -194,8 +194,7 @@ export const PanelMenuSub = React.memo( className: cx('action', { item }), target: item.target, onFocus: (event) => event.stopPropagation(), - tabIndex: '-1', - 'aria-hidden': true + tabIndex: '-1' }, getPTOptions(processedItem, 'action', index) ); diff --git a/components/lib/tieredmenu/TieredMenuSub.js b/components/lib/tieredmenu/TieredMenuSub.js index 3149a8c7ba..1a443e17b9 100644 --- a/components/lib/tieredmenu/TieredMenuSub.js +++ b/components/lib/tieredmenu/TieredMenuSub.js @@ -201,7 +201,6 @@ export const TieredMenuSub = React.memo( const actionProps = mergeProps( { href: url || '#', - 'aria-hidden': true, tabIndex: '-1', onFocus: (event) => event.stopPropagation(), className: cx('action'),