-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat: Support custom icons for ion-select
#17248
Comments
looking forward for |
I need this feature right now. Please let me know when can you do this?? |
To explain further. Currently ion-select icon sits in the shadow-root, so there is no way of disabling or editing it. With our use case, we use the detail on ion-items, and floating labels for ion-inputs, ion-selects, etc. For ion-select, it looks like this because we can't disable the select-icon. Here it is in the html of the above ion-select |
Hello, @dylan-westbury |
Currently we can use ::part to change the icon. but it's only supported in the last versions of safari/safari ios and not supported yet in samsung browser. (I have 6% of my users on samsung browser) https://caniuse.com/#search=%3A%3Apart we should maybe make a pull request to add a slot element, ::slotted is more supported. |
Hi @liamdebeasi , We have searchIcon in ion-searchbar like that please add dropdownIcon where we can add svg and string from ionicon. I tried but couldn't able to do it properly.
Playground link: https://codepen.io/indraraj26/pen/vYGPLMQ |
Hello everyone 👋 doing some housekeeping here to get this feature request up to date. I will be updating the original poster's description to reflect my understanding of this feature request. Please let me know if that is inconsistent with your expectations or if you have additional requirements you would like to include. The problem Ionic developers are facing is that the ion-select::part(icon) {
color: red;
} But they cannot customize the icon that is rendered. The ask here, is to support either a slot for developers to customize what is used as the "icon" for Similar implementation patterns that exist for reference:
|
ion-select
Issue number: resolves #17248 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> While the `icon` shadow part allows customization of the existing toggle icon, developers do not have a way to specify a different icon to use entirely. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> New props `toggleIcon` and `expandedIcon` added. (Design docs are [here](https://github.com/ionic-team/ionic-framework-design-documents/blob/main/projects/ionic-framework/components/select/0002-custom-icons.md) and [here](https://github.com/ionic-team/ionic-framework-design-documents/blob/main/projects/ionic-framework/components/select/0003-custom-icon-on-open.md) respectively.) ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Docs PR: ionic-team/ionic-docs#2996 Dev build: `7.0.15-dev.11687278023.161b97d8` --------- Co-authored-by: ionitron <[email protected]>
Props for customizing the icons have been added via #27648 and will be available in the next upcoming minor release of Ionic. Thank you! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
Developers are unable to customize the icon that is displayed with
ion-select
. Developers can change the color of the icon by using CSS:But this does not allow the flexibility for developers to customize the icon used.
Ideally, developers would like a property or slot that can be used to customize the icon that is used.
This icon could then be styled using CSS shadow parts, as the existing implementation is today.
The text was updated successfully, but these errors were encountered: