Skip to content

bug: Defining an icon in Action Sheet button properties does not render icon #29600

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

Closed
3 tasks done
magz99 opened this issue Jun 7, 2024 · 5 comments
Closed
3 tasks done
Labels

Comments

@magz99
Copy link

magz99 commented Jun 7, 2024

Prerequisites

Ionic Framework Version

v7.x, v8.x

Current Behavior

The ion-action-sheet component does not seem to render the icon provided in the ActionSheetButton properties. It happens both when the action buttons are passed as [buttons] property or via the ActionSheetController.
The icon value passed into the ActionSheetButton properties is an Ionicon name.

The <ion-icon> element will be rendered, but no icon is displayed.

image

Expected Behavior

The icon should be displayed within the ion-icon element that is rendered in the Action Sheet.

image

Steps to Reproduce

  1. Create the ActionSheetButton array, and one of the buttons will have icon defined.
  2. For the icon value, use any of the Ionicons values. Example: icon: 'add-circle-outline'
  3. Pass the button array to an action sheet element in the template:
<ion-action-sheet
  trigger="open-action-sheet"
  class="my-custom-class"
  header="Example header"
  subHeader="Example subheader"
  [buttons]="actionSheetButtons"
></ion-action-sheet>
  1. Observe the action sheet when it's opened, the icon will not be displayed

Code Reproduction URL

https://stackblitz.com/edit/angular-mnydcf?file=src%2Fapp%2Fexample.component.html

Ionic Info

I am using a stackblitz example taken from https://ionicframework.com/docs/api/action-sheet#theming

Additional Information

No response

@Julien-Marcou
Copy link

You can fix it by doing this where you are using the action sheet:

import { addIcons } from 'ionicons';
import { addCircleOutline } from 'ionicons/icons';

class YourComponent {
  constructor() {
    addIcons({
      addCircleOutline: addCircleOutline,
    });
  }
}

But as you should only need to do this when you are using angular/standalone, this is probably a bug ^^

@magz99
Copy link
Author

magz99 commented Jun 10, 2024

Thanks @Julien-Marcou , I've tested addIcons in another project with Standalone, but see the same issue there too.

@thetaPC
Copy link
Contributor

thetaPC commented Jun 11, 2024

Thank you for submitting the issue!

I'm closing this as a duplicate since we are tracking this bug through ionic-team/ionic-docs#2892. It's related to StackBlitz. The bug doesn't occur outside of StackBlitz.

@thetaPC thetaPC closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
@thetaPC thetaPC removed their assignment Jun 11, 2024
@magz99
Copy link
Author

magz99 commented Jun 11, 2024

Got it thank you.
I tried in a non-standalone project and see the icon!

Copy link

ionitron-bot bot commented Jul 11, 2024

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants