-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Support to change Icon in Dropdown Component #401
Comments
Indeed, it looks like that should be: -<Icon name={'dropdown'} />
+{createIcon(icon)} I think it should default to Would you like to make a PR? |
It looks like this needs more thought. There is a Dropdown In that type, the Dropdown can take on the classes It looks like this is what intended by the |
Good point. I'm little confused with all the possible combinations of dropdown and popup in Semantic. Don't get me wrong, it is great and has lots of power but it is a challenge in framework like React, where we try to define an API. To solve this problem now to be able to customize, may be adding a new prop On similar topic (may be this should be a new issue, if so please let me know), is it possible to attach a menu (meaning traditional menu with options, with support for nested options) to any item? If so, then we can just create a icon and attach that menu? May be something like this?
or
|
Thanks for the suggestions, I'll try them out when I get some time and report back here. I'm currently working on Forms over at #400. Preliminary FindingsHere is what I gathered yesterday that helped to clarify some things for me:
Brainstorming SolutionsGiven the above, we may be able to use a single Our offline work going on with Forms may introduce a pattern that is helpful to Dropdowns as well. We may allow either component augmentation or specialized subcomponents in <Form.Field control='input' type='password' label='Enter password:' />
<Form.Field control={Checkbox} label='I agree to the terms and conditions' />
// or
<Form.Checkbox label='I agree to the terms and conditions' /> <div class="field">
<label>Enter password:</label>
<input type='password' />
</div>
<div class="field">
<Checkbox label='I agree to the terms and conditions' />
</div> There is also a need library wide to explicitly set the element type for a component. Example, you may want to render a <Segment />
<Segment elementType='section' /> <div class="ui segment"></div>
<section class="ui segment"></section> Applying it to the DropdownAll of these ideas are ways of augmenting components. I have not thought this idea through at all, but it seems like we might support something along the lines of: <Dropdown icon='filter' options={...} />
<Dropdown.Button labeled icon='settings' options={...} />
<Dropdown.Item icon='dropdown' options={...} />
// or
<Dropdown icon='filter' options={...} />
<Button elementType={Dropdown} labeled icon='settings' options={...} />
<Menu.Item elementType={Dropdown} icon='dropdown' options={...} /> The top group The latter group I think makes more sense. Consider the Button, all the props are regular button props (labeled, icon, etc) then the extra props (options) are passed to the As I write this, I'm thinking it might help users better understand the augmentation if we use the prop name <Button as={Dropdown} labeled icon='settings' options={...} />
<Menu.Item as={Dropdown} icon='dropdown' options={...} />
// or
<Dropdown as={Button} labeled icon='settings' options={...} />
<Dropdown as={Menu.Item} icon='dropdown' options={...} /> |
I'll make a PR to fix the |
Merged and released in |
I just tried and it works great. Thank you for the quick fix. |
No problem, thanks for the report and suggestions! |
It looks like the |
The DropDown component docs says there is icon prop but specifying as no effect. Looking at the code it looks like dropdown icon is hardcoded. Changing this to use the icon prop, if specified else default dropdown would be really helpful.
I'm looking to use this component to render More Options menu with three vertical dots.
The text was updated successfully, but these errors were encountered: