salesforce / design-system-react

Salesforce Lightning Design System for React
https://design-system-react-site.herokuapp.com/
BSD 3-Clause "New" or "Revised" License
915 stars 416 forks source link

GlobalNavigationBarDropdown not showing sub menu items #3026

Open darrenparkinson opened 2 years ago

darrenparkinson commented 2 years ago

The documented GlobalNavigationBarDropdown in the Global Navigation Bar doesn't seem to work as expected. The menu appears and the chevron appears now that the utility-sprite folder is directly under assets, but the menu does not expand to show the sub menu items.

I should mention that I'm using this in next.js:

    "@salesforce-ux/design-system": "^2.17.5",
    "@salesforce/design-system-react": "^0.10.46",
    "next": "12.1.4",
    "react": "18.0.0",
    "react-dom": "18.0.0"

Any thoughts greatly appreciated. Snippet below, copied directly from the example.

import GlobalNavigationBar from '@salesforce/design-system-react/components/global-navigation-bar';
import GlobalNavigationBarRegion from '@salesforce/design-system-react/components/global-navigation-bar/region';
import GlobalNavigationBarLink from '@salesforce/design-system-react/components/global-navigation-bar/link';
import GlobalNavigationBarDropdown from '@salesforce/design-system-react/components/global-navigation-bar/dropdown';
export default function Navbar() {
    const dropdownCollection = [
        {
        label: 'Menu Item One',
        value: '1',
        iconCategory: 'utility',
        iconName: 'table',
        href: 'http://www.google.com',
    },
    ];
    return (
        <>
           <GlobalNavigationBar>
               <GlobalNavigationBarRegion region="secondary" navigation>
                        <GlobalNavigationBarLink active href="/" label="Home" id="home-link" />
                        <GlobalNavigationBarDropdown
                               assistiveText={{ icon: 'Open menu item submenu' }}
                               id="primaryDropdown"
                               label="Menu Item"
                               options={dropdownCollection}
            />
            </GlobalNavigationBarRegion>
        </GlobalNavigationBar>               
    </>
    )
}
welcome[bot] commented 2 years ago

Thanks for opening your first issue! :wave: If you have found this library helpful, please star it. A maintainer will try to respond within 7 days. If you haven’t heard anything by then, please bump this thread.