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

[Autocomplete] Ability to change the IconButton SVG Icon #18227

Closed
1 task done
AbdullahElrubi opened this issue Nov 6, 2019 · 9 comments · Fixed by #18266
Closed
1 task done

[Autocomplete] Ability to change the IconButton SVG Icon #18227

AbdullahElrubi opened this issue Nov 6, 2019 · 9 comments · Fixed by #18266
Assignees
Labels
component: autocomplete This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@AbdullahElrubi
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

I'd like to change the IconButton SVG Icon instead of the original <ArrowDropDownIcon /> with having all of its handlers and classes being able to change.

Examples 🌈

This is how it would be. This is my SVG Icon <KeyboardArrowDownIcon/>
image

This is the original one used.
image

Motivation 🔦

An app that I'm working on requires an autocomplete field but it's required from me to change the Icon to fit all the app Icons

@oliviertassinari oliviertassinari added new feature New feature or request component: autocomplete This is the name of the generic UI component, not the React module! labels Nov 6, 2019
@oliviertassinari
Copy link
Member

@AbdallahElroby Have you thought of the API you would like to use for this customization? Maybe a PopupIconButtonComponent prop?

@mbrookes
Copy link
Member

mbrookes commented Nov 6, 2019

PopupIconComponent ?

@oliviertassinari oliviertassinari added the good first issue Great for first contributions. Enable to learn the contribution process. label Nov 6, 2019
@AbdullahElrubi
Copy link
Contributor Author

AbdullahElrubi commented Nov 6, 2019

@oliviertassinari I think it might be like you suggested but the catch is that we've two IconButtons actually, one for the CloseIcon and one for the <ArrowDropDownIcon /> and right now I can replace them using this:

                             InputProps={{
                                ...params.InputProps,
                                endAdornment: (
                                    <React.Fragment>
                                        {(this.state.loading && x.id === this.state.id) ? <CircularProgress color="inherit" size={20} /> : null}
                                        {openIcon}
                                    </React.Fragment>
                                ),
                            }}

Now let's say the proper API for these two Icons will be:

  1. CloseIcon: CloseIconComponent .
  2. ArrowDropDownIcon : PopupIconComponent as suggested by @mbrookes

@oliviertassinari
Copy link
Member

@AbdallahElroby This sounds good to me

@AbdullahElrubi
Copy link
Contributor Author

@oliviertassinari So when will we see a pull request by these APIs

@joshwooding
Copy link
Member

@AbdallahElroby This issue is marked "good first issue". This means core team members tend to not work on them and leave them for the community, therefore giving a deadline is quite a difficult task as it relies on a member of the community or a new contributor picking up the issue. If you would like to see it added quicker I would recommend reading CONTRIBUTING.md and giving it a go yourself, we are happy to help you if you get stuck :)

@AbdullahElrubi
Copy link
Contributor Author

@oliviertassinari I've made a PR with this issue
I'm kinda urgently need it to the project I'm working on

@Amirhossein-Moghadam
Copy link

Amirhossein-Moghadam commented Dec 8, 2021

Hi , if you use Autocomplete , it's better to use "popupIcon" , because Textfield is different from AutoComplete and when you use inputProps , autocomplete doesn't show options.

<Autocomplete popupIcon={ <<ArrowDropDownIcon />/> } />

@eSpark-Abideena
Copy link

<Autocomplete
popupIcon={<KeyboardArrowDownIcon sx={{ color: '#777777' }}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants