-
Notifications
You must be signed in to change notification settings - Fork 4k
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
RFC: Dropdown header and divider shorthands #1724
Comments
Implementation from the top of my head Before Dropdown.js#L1165
After
|
Thank you for starting this RFC. In addition to the linked #889, it is also closely related to #1365 (submenu's and nested dropdown menu's). I'd propose that we standardize on the Headerconst options = [
{ component: Dropdown.Header, icon: 'tags', content: 'Filter by tag' },
{ content: 'Important' },
{ content: 'Announcement' },
{ content: 'Discussion' }
]
// <Dropdown.Header icon='tags' content='Filter by tag' />
// <Dropdown.Item>Important</Dropdown.Item>
// <Dropdown.Item>Announcement</Dropdown.Item>
// <Dropdown.Item>Discussion</Dropdown.Item> Dividerconst options = [
{ content: 'Important' },
{ component: Dropdown.Divider },
{ content: 'Announcement' },
{ content: 'Discussion' }
]
// <Dropdown.Item>Important</Dropdown.Item>
// <Dropdown.Divider />
// <Dropdown.Item>Announcement</Dropdown.Item>
// <Dropdown.Item>Discussion</Dropdown.Item> |
In this case why don't do something like
? |
Here's another thing. Let's say we implemented this and updated the examples, like, the first one
The problem is now the state is fully managed so when clicking on some option we get all of our options bolded. It's because they has no value, so it's empty value now selected and all options are highlighted. But there shouldn't be any state management in a such use case, because it's not the value we wan't but immediate action on option selection. So it raises two questions
|
Thanks for the PR, let's move discussions over there! |
need this feature |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please avoid +1 and status comments as they send all subscribers emails and notifications. All work is public and status can be tracked by looking at the open referenced PR, #1757. Additionally, emoji reactions on the original description are more useful as they do not send notifications and they enable issue sorting. |
There has been no activity in this thread for 90 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 90 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
Finally, we have a decision there, we will go with the |
There has been no activity in this thread for 180 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 180 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
There has been no activity in this thread for 180 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 180 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
Hello @layershifter, since your feature #4029 is merged, is it possible to use shorthands for Dropdown options to create Header and Divider instead of item ? If yes, how ? I'm not sure to understand the feature correctly I am in a case where I need a If we don't use shorthands we have to recode the search, the selection and manage multiple values manually which is a bit annoying |
What seems to do the trick after #4029 is to define headers and dividers as follows within the dropdown options:
|
https://react.semantic-ui.com/modules/dropdown#dropdown-example-header
I wanna use
Dropdown.Header
andDropdown.Divider
insearch
ormultiple
dropdown, but it's currently not supported. So I suppose we should extend shorthand props to support it. But it can be done in many ways so it's better to consider different options.Header
I think the header shorthand is pretty straitforward
Divider
I think it should be implemented by using
divider
shorthand with position as shorthand value. Possible positions will be'top' | 'bottom' | 'both'
.The text was updated successfully, but these errors were encountered: