Skip to content

Commit

Permalink
Disable button when it's loading
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Oct 17, 2024
1 parent a402761 commit 4fa5afa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private fun CoreButton(
onClick: () -> Unit,
imageVector: ImageVector?,
) {
val isEnabled by remember { derivedStateOf { enabled() || showIndeterminateProgress() } }
val isEnabled by remember { derivedStateOf { enabled() && !showIndeterminateProgress() && progress == null } }
val buttonColors = style.buttonColors()

Button(
Expand Down Expand Up @@ -155,7 +155,7 @@ private fun ButtonTextContent(imageVector: ImageVector?, titleRes: Int, modifier

@Composable
private fun getProgressSpecs(buttonColors: ButtonColors): Pair<Color, Modifier> {
val progressColor = buttonColors.contentColor
val progressColor = buttonColors.disabledContentColor
val progressModifier = Modifier
.fillMaxHeight(0.8f)
.aspectRatio(1f)
Expand Down

0 comments on commit 4fa5afa

Please sign in to comment.