File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ const InternalMenuItem = (props: MenuItemProps) => {
200200 elementRef = { elementRef }
201201 role = { role === null ? 'none' : role || 'menuitem' }
202202 tabIndex = { disabled ? null : - 1 }
203- data-menu-id = { overflowDisabled ? null : domDataId }
203+ data-menu-id = { overflowDisabled && domDataId ? null : domDataId }
204204 { ...restProps }
205205 { ...activeProps }
206206 { ...optionRoleProps }
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ const InternalSubMenu = (props: SubMenuProps) => {
230230 } ;
231231
232232 // =============================== Render ===============================
233- const popupId = `${ domDataId } -popup` ;
233+ const popupId = domDataId && `${ domDataId } -popup` ;
234234
235235 // >>>>> Title
236236 let titleNode : React . ReactElement = (
@@ -241,7 +241,7 @@ const InternalSubMenu = (props: SubMenuProps) => {
241241 tabIndex = { mergedDisabled ? null : - 1 }
242242 ref = { elementRef }
243243 title = { typeof title === 'string' ? title : null }
244- data-menu-id = { overflowDisabled ? null : domDataId }
244+ data-menu-id = { overflowDisabled && domDataId ? null : domDataId }
245245 aria-expanded = { open }
246246 aria-haspopup
247247 aria-controls = { popupId }
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import * as React from 'react';
33export const IdContext = React . createContext < string > ( null ) ;
44
55export function getMenuId ( uuid : string , eventKey : string ) {
6+ if ( uuid === undefined ) {
7+ return null ;
8+ }
69 return `${ uuid } -${ eventKey } ` ;
710}
811
You can’t perform that action at this time.
0 commit comments