Skip to content

Add submenu feature for Dropdown #9745

Description

@Anastasiia-Boleiko

Check existing issues

Description

Dropdowns have the functionality to display submenus.

Acceptance Criteria

  • Dropdowns display submenus via a named slot on Dropdown Item
  • Users can slot both Dropdown Items and/or Dropdown Item Groups into submenus
  • Documentation of dos/avoids (refer to internal repo issue)

See Figma file for full design requirements and additional details 🔗

Which Component

Dropdown
Dropdown Item
Dropdown Item Group

Example Use Case

Different menus with submenus opened from the floating toolbars.

Additional use cases outlined in this comment.

Priority impact

impact - p1 - need for current milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Urban

monday.com sync: #9365337583

Ideas explored in design file:

1. slot="submenu-item" and text property

<calcite-dropdown>
    <calcite-button slot="trigger" icon-start="ellipsis">
    </calcite-button>
    <calcite-dropdown-group selection-mode="none">
        <calcite-dropdown-item text="Locate"></calcite-dropdown-item>
        <calcite-dropdown-group group-title="Duplicate to" selection-mode="none">
            <calcite-dropdown-item text="Existing" slot="submenu-item"></calcite-dropdown-item>
            <calcite-dropdown-item text="Scenario 2" slot="submenu-item">Scenario 2</calcite-dropdown-item>
        </calcite-dropdown-group>
        <calcite-dropdown-item text="Locate"></calcite-dropdown-item>
        <calcite-dropdown-item text="Resize"></calcite-dropdown-item>
        <calcite-dropdown-item text="Preview"></calcite-dropdown-item>
        <calcite-dropdown-item text="Add Custom ID"></calcite-dropdown-item>
        <calcite-dropdown-item text="Get info"></calcite-dropdown-item>
    </calcite-dropdown-group>
</calcite-dropdown>

2. display-mode="open-list | submenu", where

open-list - is a default, how the group is displayed now.
It seems to be non breaking change 😊

<calcite-dropdown>
    <calcite-button slot="trigger" icon-start="ellipsis">
    </calcite-button>
    <calcite-dropdown-group selection-mode="none">
        <calcite-dropdown-item>Locate</calcite-dropdown-item>
        <calcite-dropdown-group group-title="Duplicate to" selection-mode="none" display-mode="submenu">
            <calcite-dropdown-item>Existing</calcite-dropdown-item>
            <calcite-dropdown-item>Scenario 2</calcite-dropdown-item>
        </calcite-dropdown-group>
        <calcite-dropdown-item>Locate</calcite-dropdown-item>
        <calcite-dropdown-item>Resize</calcite-dropdown-item>
        <calcite-dropdown-item>Preview</calcite-dropdown-item>
        <calcite-dropdown-item>Add Custom ID</calcite-dropdown-item>
        <calcite-dropdown-item>Get info</calcite-dropdown-item>
    </calcite-dropdown-group>
</calcite-dropdown>

3. New calcite-dropdown-submenu child item, inherits calcite-dropdown-group properties (ex.: selection)

It seems to be non breaking change 😊

<calcite-dropdown>
    <calcite-button slot="trigger" icon-start="ellipsis">
    </calcite-button>
    <calcite-dropdown-group selection-mode="none">
        <calcite-dropdown-item>Locate</calcite-dropdown-item>
        <calcite-dropdown-submenu submenu-title="Duplicate to" selection-mode="none">
            <calcite-dropdown-item>Existing</calcite-dropdown-item>
            <calcite-dropdown-item>Scenario 2</calcite-dropdown-item>
        </calcite-dropdown-submenu>
        <calcite-dropdown-item>Locate</calcite-dropdown-item>
        <calcite-dropdown-item>Resize</calcite-dropdown-item>
        <calcite-dropdown-item>Preview</calcite-dropdown-item>
        <calcite-dropdown-item>Add Custom ID</calcite-dropdown-item>
        <calcite-dropdown-item>Get info</calcite-dropdown-item>
    </calcite-dropdown-group>
</calcite-dropdown>

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - ready for devIssues that are designed, have acceptance criteria defined, and are ready for a developer to pick upArcGIS OnlineIssues logged by ArcGIS Online team members.ArcGIS SolutionsIssues logged by ArcGIS Solutions team members.ArcGIS UrbanIssues logged by ArcGIS Urban team members.calcite-componentsIssues specific to the @esri/calcite-components package.calcite-components-reactIssues specific to the @esri/calcite-components-react package.designIssues that need design consultation prior to, or during, development.docsIssues relating to documentation updates only.enhancementIssues tied to a new feature or request.estimate - 5A few days of work, definitely requires updates to tests.estimate - design - 21Requires planning, input from team members and possibly others.impact - p1 - need for current milestoneUser set priority impact status of p1 - need for current milestonep - highIssue should be addressed in the current milestone, impacts component or core functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions