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

bug: Ionic v8 addIcon not working with composed name icons #1380

Open
hbapps20 opened this issue May 18, 2024 · 6 comments
Open

bug: Ionic v8 addIcon not working with composed name icons #1380

hbapps20 opened this issue May 18, 2024 · 6 comments
Labels
triage New issues

Comments

@hbapps20
Copy link

Current Behavior

I'm trying to use multiple ionic icons in my application, but only the simple ones are working for example: exit, calendar, add. If I try

it is not working.

Here are some examples:

html
<ion-footer> <ion-list> <ion-menu-toggle menu="m1"> <ion-item lines="none" (click)="onLogout()" button> <ion-icon name="exit" slot="start"></ion-icon> <ion-label>Salir</ion-label> </ion-item> </ion-menu-toggle> </ion-list> </ion-footer>

ts

import { ellipsisVerticalOutline, exit } from "ionicons/icons";
import { addIcons } from "ionicons";
export class AppComponent implements OnInit, OnDestroy {
...
constructor(
private platform: Platform,
//rivate splashScreen: SplashScreen,
//private statusBar: StatusBar,
private authService: AuthService,
private locationService: LocationService,
private router: Router,
private menuCtrl: MenuController,
private alertCtrl: AlertController,
//private messagingService: MessagingService,
// private translateService: TranslateService
) {
this.initializeApp();
addIcons({exit,ellipsisVerticalOutline});
}

}

image

If I change html for:
<ion-footer> <ion-list> <ion-menu-toggle menu="m1"> <ion-item lines="none" (click)="onLogout()" button> <ion-icon name="ellipsis-vertical-outline"></ion-icon> <ion-label>Salir</ion-label> </ion-item> </ion-menu-toggle> </ion-list> </ion-footer>

image

Not Working.

Expected Behavior

That the icon I'm using shows

Steps to Reproduce

Use some basic icons with no composed names like exit, calendar
Then use some icons like

Code Reproduction URL

No response

Additional Information

No response

@hbapps20 hbapps20 added the triage New issues label May 18, 2024
@liamdebeasi
Copy link
Contributor

Do you have a runnable sample that can be used to reproduce the issue? Also make sure you are using the latest version of Ionicons.

@manubravo
Copy link

manubravo commented Aug 8, 2024

hi, i've the same problem. How does it update? im using Angular 18.0.0, ionic 8.0.0 & "ionicons": "^7.2.1".
I have followed the official docs to start my first application in Ionic with angular .... but the icons do not work.
I've executed the last version (npm install ionicons@latest) & still not working with 7.4.0

@liamdebeasi
Copy link
Contributor

The team needs a runnable sample in order to reproduce the issue. If one is not provided, then the team may close this as they will be unable to reproduce the problem.

@manubravo
Copy link

Ok, I'll attach screenshots later, maybe I'm missing something, but I'm following the official documentation which makes a simple app to take pictures

@hbapps20
Copy link
Author

hbapps20 commented Aug 8, 2024

@manubravo what I did was to download the svg icon from ionic icon's library icons and download it in my assets folder, then use it like this:

html - icon_whatsaap.svg

<ion-row class="ion-no-margin ion-no-padding">
              <ion-list style="margin-left:22px;margin-right: 25px; width: 100%;">
                <ion-item lines="full" (click)="onShareContentWa()" style="--border-color:rgba(0, 0, 0, 0.03);">
                  <ion-icon color="medium" src="../../../../assets/icons/icon_whatsaap.svg"></ion-icon>
                  <ion-label>
                    <h3 style="margin-left:40.5px;color:var(--ion-color-medium,lightgrey);">Enviar Whatsaap</h3>
                  </ion-label>
                </ion-item>      
              </ion-list>
            </ion-row>

This would provide you with the same ion-icon properties. However, I still believe there is a bug with the ionic-icons.

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Aug 8, 2024

A runnable sample (such as an app in a GitHub repo) would be better instead of screenshots because it ensures the team can reproduce the issue on their computers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New issues
Projects
None yet
Development

No branches or pull requests

3 participants