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

fix(button): allow any element type to to use the "icon-only" slot #22168

Merged
merged 7 commits into from
Oct 6, 2020

Conversation

bitflower
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Not sure if this has or needs a test?

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Only ion-icon are recognized inside the slots to indicate the button's iconOnly mode.

What is the new behavior?

Any element with slot='icon-only' is recognized.

Does this introduce a breaking change?

  • Yes
  • No

@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Sep 24, 2020
@bitflower
Copy link
Contributor Author

bitflower commented Sep 24, 2020

Use case: Avatar image (for example @claviska 's sl-avatar) in an ion-toolbar:
image

@liamdebeasi
Copy link
Contributor

Thanks for the PR! Could you please provide a code example of the use case in #22168 (comment) that highlights the current issues you are running into with icon-only?

@bitflower
Copy link
Contributor Author

Sure, I want to use the component sl-avatar from the Shoelace Design System. It's has the appearance of an icon = round. That's why I want to treat it as icon-only to center it inside the button.

Sample code to my example image from the comment above:

<ion-button>
   <sl-avatar slot='icon-only' />
</ion-button>

@liamdebeasi
Copy link
Contributor

Thanks! It sounds like you are mostly interested in ensuring that the ripple effect correctly covers the sl-avatar component?

@bitflower
Copy link
Contributor Author

bitflower commented Sep 25, 2020

a) the covering would be nice but b) having a round ripple is more important. Right now it's a rectangle.

@brandyscarney brandyscarney changed the title Allow any element type to to indicate the "iconOnly" state fix(button): allow any element type to to use the "icon-only" slot Oct 6, 2020
@brandyscarney brandyscarney merged commit c454c84 into ionic-team:master Oct 6, 2020
TakumaKira pushed a commit to TakumaKira/ionic-framework that referenced this pull request Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants