Open philmtd opened 5 years ago
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Please describe the feature you would like to request.
Current behaviour: When a dialog is closed with esc or via backdrop click the provided result is
undefined
. Desired behaviour: Allow to set a default result for these situations. I'd see several possible ways of doing this, for example:MatDialogRef
and a to be created method (e.g.setDefaultResult(...)
) to be able to set this value comfortably from within the dialog.What is the use-case or motivation for this proposal?
We have some generic dialogs which also provide a "cancel" button that returns specific data. Currently everywhere the dialog is opened, we need to make a check whether the result is undefined or not. Providing a default value for those cases would definitely be better.