rio-labs / rio

WebApps in pure Python. No JavaScript, HTML and CSS needed
https://rio.dev
Apache License 2.0
1.32k stars 38 forks source link

Feature Request: Support Multiselect for `rio.Dropdown` #52

Open Sn3llius opened 3 months ago

Sn3llius commented 3 months ago

Discussed in https://github.com/rio-labs/rio/discussions/50

Originally posted by **Sn3llius** June 7, 2024 ### Summary: It would be great to have multiselect support for the rio.Dropdown component in Rio. This feature would enhance the usability and flexibility of dropdown menus by allowing users to select multiple options at once. ### Detailed Description: Currently, the `rio.Dropdown` component supports single selection, which is sufficient for many use cases. However, there are scenarios where selecting multiple items from a dropdown is necessary. Adding multiselect functionality would greatly benefit users who need to choose several options without having to use multiple dropdown components or creating their own suboptimal solutions. ### Proposed Solution: - Implement a multiselect mode for `rio.Dropdown` that can be activated through a new attribute (or potentially as a separate component). - Ensure that selected items are displayed clearly within the dropdown, with an option to deselect each item. - Provide keyboard and mouse support for selecting and deselecting multiple items. - Allow for custom styling to accommodate different design requirements. - Include support for components like checkboxes for selecting items ### Benefits: - Improved user experience by reducing the need for multiple dropdowns. - Increased flexibility in form design and data selection. - Enhanced productivity for users needing to make bulk selections. ### Additional Context: Multiselect dropdowns are common in many applications and frameworks, such as React and Flutter. Bringing this feature to Rio will align it with modern UI component standards and fulfill the needs of more complex user interactions. **Looking forward to the discussion and feedback from the community!**
mad-moo commented 1 month ago

This should be a new component, rather than being integrated into dropdowns IMHO. Multiselect would need a differetn API, and pass different event objects. This would be confusing for both the type checker & the user.