From 085a6cf26731da68f4d30e732766609518b28ea4 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Tue, 27 May 2025 11:55:57 -0700 Subject: [PATCH] fix(IconOpts): value not recomposing in remembered lambda --- .../aliucord/manager/ui/screens/iconopts/IconOptionsScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/aliucord/manager/ui/screens/iconopts/IconOptionsScreen.kt b/app/src/main/kotlin/com/aliucord/manager/ui/screens/iconopts/IconOptionsScreen.kt index c7e61ee..e97b96e 100644 --- a/app/src/main/kotlin/com/aliucord/manager/ui/screens/iconopts/IconOptionsScreen.kt +++ b/app/src/main/kotlin/com/aliucord/manager/ui/screens/iconopts/IconOptionsScreen.kt @@ -191,6 +191,8 @@ private fun CustomColorOptions( color: HsvColor, setColor: (HsvColor) -> Unit, ) { + val color by rememberUpdatedState(color) + // This color is separated from the live color and intentionally lags behind while the RGBTextField is being edited. // When this changes, then the text inside the RGBTextField is reset to the fully formatted color. // As such, this only happens when the color is changed via the other color pickers. @@ -210,7 +212,6 @@ private fun CustomColorOptions( saturation = color.saturation, value = color.value, onColorChange = { hue, saturation -> - // FIXME: lightness slider resets when color wheel is used color.copy(hue = hue, saturation = saturation).let { setColor(it) initialRGBFieldColor = it.toColor()