Add Submenu support to Dropdown component

Open
#2,559 3 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react
Domain
design, frontend

Research direction

Start with the Dropdown component and compare its current behavior with the Salesforce Lightning Design System submenu specification linked in the issue. Use the proposed nested options structure as the input shape; the work is done when Dropdown supports submenu items, dividers, and their expected interactions.

Written by the indexing model from the issue text.

Description

menu-dropdown

Add submenu support to the Dropdown component according to the spec: https://lightningdesignsystem.com/components/menus/#With-a-Submenu

Here's a proposal for how to represent submenu items:

Untitled
[
    {
        "id": "1",
        "label": "Menu Item One",
        "type": "item",
        "value": "1"
    },
    {
        "id": "2",
        "label": "Menu Item Two",
        "type": "item",
        "value": "2"
    },
    {
        "id": "3",
        "label": "Menu Item Three",
        "type": "item",
        "value": "3",
        "options": [
            {
                "id": "3-1",
                "label": "Submenu Item One",
                "type": "item",
                "value": "3-1"
            },
            {
                "id": "3-2",
                "label": "Submenu Item Two",
                "type": "item",
                "value": "3-2"
            },
            {
                "id": "3-3",
                "label": "Submenu Item Three",
                "type": "item",
                "value": "3-3"
            },
            {
                "type": "divider"
            },
            {
                "id": "3-4",
                "label": "Submenu Item Four",
                "type": "item",
                "value": "3-4"
            }
        ]
    }
]
Dominant language
JavaScript
Stars
994
Forks
444
Avg merge
3d 23h
Merged PRs (30d)
44

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from salesforce/design-system-react

All issues in salesforce/design-system-react

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.