feat(toast): add stacked buttons functionality - #26790
Merged
Merged
Conversation
|
|
sean-perkins
approved these changes
Feb 14, 2023
sean-perkins
left a comment
Contributor
There was a problem hiding this comment.
Changes look good to me, nice work!
Be aware when we sync this with feature-7.0, we will need to rebuild and update the generated proxies for the Angular package. In v6.x we exclude generating proxies for ion-toast, but in v7 we generate a proxy for the inline usage/type support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs PR: ionic-team/ionic-docs#2768
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docsrepo, in a separate PR. See the contributing guide for details.npm run build) was run locally and any changes were pushednpm run lint) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue URL: Internal ticket
The Material Design guidelines for snackbars/toasts allow for stacked buttons where buttons appear on a separate line: https://m2.material.io/components/snackbars#specs
Ionic does not have support for this.
What is the new behavior?
layoutproperty toion-toastthat allows for content to be stacked.Note: We investigated handling this automatically with CSS. Here is a sample of handling this with CSS: https://codepen.io/sean-perkins/pen/JjZyvoW. We decided against this approach because it does not allow the default behavior of the message/button appearing on the same line with the message wrapping within its own container. Handling this with CSS means that long message texts always push buttons onto the next line instead instead of having the message wrap within its own container.
Note 2: Using start and end buttons with the stacked layout is an anti-pattern, but I used both in my tests to avoid having duplicate screenshots.
Does this introduce a breaking change?
Other information
Note on naming: We opted to rename the values from
inlineandstackedtobaselineandstackedto avoid confusion with the inline toast feature where devs can write<ion-toast>instead of using a controller. The "baseline" term is something MD uses in https://material-components.github.io/material-components-web-catalog/#/component/snackbar.