-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Know if a snackbar is dismissed by action or not #9147
Labels
P4
A relatively minor issue that is not relevant to core functions
Comments
crisbeto
added
the
P4
A relatively minor issue that is not relevant to core functions
label
Dec 28, 2017
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Dec 28, 2017
…sult of an action Adds a boolean to the `MatSnackBarRef.afterDismissed` result that indicates whether the dismissal came as a result of the user pressing the action button. Fixes angular#9147.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 13, 2018
…sult of an action Adds a boolean to the `MatSnackBarRef.afterDismissed` result that indicates whether the dismissal came as a result of the user pressing the action button. Fixes angular#9147.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 17, 2018
…sult of an action Adds a boolean to the `MatSnackBarRef.afterDismissed` result that indicates whether the dismissal came as a result of the user pressing the action button. Fixes angular#9147.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 18, 2018
…sult of an action Adds a boolean to the `MatSnackBarRef.afterDismissed` result that indicates whether the dismissal came as a result of the user pressing the action button. Fixes angular#9147.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jan 19, 2018
…sult of an action Adds a boolean to the `MatSnackBarRef.afterDismissed` result that indicates whether the dismissal came as a result of the user pressing the action button. Fixes angular#9147.
jelbourn
pushed a commit
that referenced
this issue
Jan 21, 2018
…sult of an action Adds a boolean to the `MatSnackBarRef.afterDismissed` result that indicates whether the dismissal came as a result of the user pressing the action button. Fixes #9147.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Proposal:
When the snackbar is dismissed by click on the action button, the observable onAction() is called, but also the observable afterDismissed().
When the snackbar is dismissed by the timer or the function dismiss(), there are just the afterDismissed() observable called.
There are no option to know if the dismissed has origin by the action or other.
The use case is to have a delete message with a cancel action, if the dismiss hasn't origin by the action, we must do the delete on server, otherwise restore in the interface the delete item.
What is the expected behavior?
We can add to boolean result in the afterDismissed :
Or add a new observable :
What is the current behavior?
The observable afterDismissed is called everytime with or without action.
The text was updated successfully, but these errors were encountered: