mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-02 06:24:16 +02:00
fix: disable preference footer buttons when there are no unsaved changes
Fixes #5282 by properly passing the enabled parameter to the ElevatedButtons in PreferenceFooter.
This commit is contained in:
@@ -52,6 +52,7 @@ fun PreferenceFooter(
|
||||
shapes = ButtonDefaults.shapesFor(mediumHeight),
|
||||
modifier = Modifier.height(mediumHeight).weight(1f),
|
||||
colors = ButtonDefaults.filledTonalButtonColors(),
|
||||
enabled = enabled,
|
||||
onClick = onNegativeClicked,
|
||||
) {
|
||||
Text(text = negativeText, style = ButtonDefaults.textStyleFor(mediumHeight))
|
||||
@@ -63,7 +64,8 @@ fun PreferenceFooter(
|
||||
shapes = ButtonDefaults.shapesFor(mediumHeight),
|
||||
modifier = Modifier.height(mediumHeight).weight(1f),
|
||||
colors = ButtonDefaults.buttonColors(),
|
||||
onClick = { if (enabled) onPositiveClicked() },
|
||||
enabled = enabled,
|
||||
onClick = onPositiveClicked,
|
||||
) {
|
||||
Text(text = positiveText, style = ButtonDefaults.textStyleFor(mediumHeight))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user