Enable confirmButton only when needed to respond to user input (#8848)

* Enable `confirmButton` when appropriate

* Show error in dialog instead

* Follow M3 guidelines
This commit is contained in:
zbue
2023-01-15 07:24:57 +08:00
committed by GitHub
parent 62480f090b
commit 33a2219716
12 changed files with 68 additions and 47 deletions

View File

@@ -42,6 +42,7 @@ fun DownloadCustomAmountDialog(
},
confirmButton = {
TextButton(
enabled = amount != 0,
onClick = {
onDismissRequest()
onConfirm(amount.coerceIn(0, maxAmount))