Skip to content

feat(toast): add support for closeButtonIcon - #16268

Closed
simonhaenisch wants to merge 7 commits into
ionic-team:masterfrom
simonhaenisch:feat-toast-close-button-icon
Closed

simonhaenisch wants to merge 7 commits into
ionic-team:masterfrom
simonhaenisch:feat-toast-close-button-icon

Conversation

@simonhaenisch

@simonhaenisch simonhaenisch commented Nov 8, 2018 •

Copy link
Copy Markdown
Contributor

Short description of what this resolves:

Adds the possibility to add an icon to the close button (either with or without a text).

Closes #16237.

Changes proposed in this pull request:

  • add a closeButtonIcon prop to toasts
Android iOS

Ionic Version: 4.0.0-beta.16 ?


I added demos to test/basic/index.html and test/preview/index.html, should I add them to test/standalone/index.html as well? Also, should I add new test cases to the e2e tests for that? Seems like only basic functionality of the toast, i. e., show and dismiss, is tested (maybe on purpose?).

@ionitron-bot ionitron-bot Bot added the package: core @ionic/core package label Nov 8, 2018
@paulstelzer

Copy link
Copy Markdown
Contributor

Could you resolve the conflicts with the branch?

@simonhaenisch

Copy link
Copy Markdown
Contributor Author

@paulstelzer just merged... could you please explain why the build failed? Does that mean I have to update the API docs somewhere or something?

@paulstelzer

paulstelzer commented Dec 17, 2018 •

Copy link
Copy Markdown
Contributor

You have to commit the api.txt, too

@simonhaenisch

Copy link
Copy Markdown
Contributor Author

@paulstelzer ok, I used the Github interface to resolve the conflicts... that's why I missed that. Should be ok now?

@paulstelzer

Copy link
Copy Markdown
Contributor

Thanks! I try to concince @manucorporat and @brandyscarney because the icon is not something that is in MD Design - but it's optional, so I hope it's get green light ;)

@brandyscarney

Copy link
Copy Markdown
Member

Thanks for the PR! I think if this were to be implemented the API should match how action sheet and other overlays work, for example:

buttons: [{
  text: 'Close',
  role: 'close',
  icon: 'trash',
  show: false // true by default
  handler: () => {
    console.log('Close clicked');
  }
}, {

Thoughts?

@simonhaenisch

simonhaenisch commented Dec 19, 2018 •

Copy link
Copy Markdown
Contributor Author

@brandyscarney this kind of implies that it's possible to have multiple buttons, right? Other than that I like the idea.

Edit: Multiple toast buttons is actually a thing, just had one in Gmail. It also had a close icon, which was circled when hovering (on desktop). The snackbar spec has not been updated yet though.

Normal Hover
image image

Should there also be a color option for the button? The spec says that the button color shouldn't be the same as the text button.

@brandyscarney

Copy link
Copy Markdown
Member

Should there also be a color option for the button? The spec says that the button color shouldn't be the same as the text button.

Hmmm yeah I would think so. But we may run into problems with passing color to the button since toast uses shadow (we have in the past).

I think it could go hand in hand with this issue: #16791 (comment)

@simonhaenisch

Copy link
Copy Markdown
Contributor Author

Closing in favor of #17147.

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.

[v4] feature: close button icon for toasts

3 participants