Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create MultiSelect component #210

Open
tom-leamon opened this issue Nov 24, 2023 · 1 comment
Open

Create MultiSelect component #210

tom-leamon opened this issue Nov 24, 2023 · 1 comment
Labels
app Components intended for creating and managing things new component

Comments

@tom-leamon
Copy link
Contributor

tom-leamon commented Nov 24, 2023

The MultiSelect is a component that allows users to select multiple items from a list. It supports selection of items both individually and in a range (by clicking and dragging to create a selection box).

Features include:

  • Single selection by clicking on an item.
  • Multiple selection by holding down the 'CTRL' key (or 'CMD' on Mac) and clicking on multiple items.
  • Range selection by holding down the 'Shift' key and clicking two items; all items in between will be selected.
  • Range selection can also be done by clicking and dragging to create a selection box around the items.
  • Deselecting an individually selected item within a range can be done by holding down the 'CTRL' key (or 'CMD' on Mac) and clicking on the item.
  • All selections can be cleared by pressing the 'Escape' key.

Moreover, it also creates a context menu using the ContextMenu component that displays when the user clicks on an item with right button mouse click. The menu options for the context menu are customizable. For example, the parent component could choose to delete the selected items.

The MultiSelect component has a styled container with relative position, no user select, and padding. Each item in the MultiSelect component is styled with a conditional background color and border, changes when selected. If the user is dragging to select, a selection box is displayed, styled with dashed border, semi-transparent background color, absolute position, and not interacts with the pointer.

@tom-leamon tom-leamon added new component app Components intended for creating and managing things labels Nov 24, 2023
@tom-leamon tom-leamon pinned this issue Dec 7, 2023
@tom-leamon
Copy link
Contributor Author

tom-leamon commented Dec 7, 2023

  • Add touch support for selection
  • Ensure hold to touch does not deselect exiting selection
  • Use theme-friendly colors for selection
  • Allow for both vertical and horizontal layouts
  • Support item reordering
  • Support ability to drag and drop selection
  • Customize about of space between items
  • Document requirements around what happens when dragging outside of container
  • Fix bug where you can select different things and the ContextMenu stays open
  • Make sure it's possible for items to have their own ContextMenu rather than only supporting the MultiSelect single insance ContextMenu - perhaps differentiate between single and multi selection
  • Add arrow keys to change selection items - when multi rows, account for arrangement to allow all four directions
  • Add additional stories and use cases - list, file browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Components intended for creating and managing things new component
Projects
None yet
Development

No branches or pull requests

1 participant