Skip to content

SelectionGroup component for Menu to support more than one selection modes. #1621

@intergalacticspacehighway

Description

🙋 Feature Request

SelectionGroup component will allow putting selection mode on groups.
This is a fairly common use-case. See the screenshot attached in examples - there are 2 groups, one has a "single" selection mode and the other has "none".

🤔 Expected Behavior

A single menu component should support more than one selection mode.

😯 Current Behavior

Currently, selection mode can be specified only on the Menu component.

💁 Possible Solution

<Menu>
  <Section title="Style">
    <SelectionGroup selectionMode="multiple" selectedKeys={selectedFormats}>
      <Item key="bold">Bold</Item>
      <Item key="italic">Italic</Item>
      <Item key="underline">Underline</Item>
    </SelectionGroup>
  </Section>
  <Section title="Align">
    <SelectionGroup selectionMode="single" selectedKeys={selectedFormats}>
      <Item key="left">Left</Item>
      <Item key="center">Center</Item>
      <Item key="right">Right</Item>
    </SelectionGroup>
  </Section>
</Menu>

🔦 Context

Have discussed this with @devongovett and we found this is a fairly common use case.

💻 Examples

Screenshot 2021-02-23 at 10 27 13 AM

🧢 Your Company/Team

GeekyAnts

GeekyAnts/NativeBase

🎁 Tracking Ticket (optional)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions