godaddy / compose-color-picker

Jetpack Compose Android Color Picker 🎨
MIT License
369 stars 23 forks source link

Use rememberUpdatedState to prevent stale lambda capture #24

Closed halilozercan closed 1 year ago

halilozercan commented 1 year ago

If a composable passes a lambda argument down to other composables via wrapping, lambda gets captured which may not read the latest state when executed. rememberUpdatedState fixes this problem.

ffgiraldez commented 1 year ago

Hi, @halilozercan thanks for this fix. Could you please also add it to the HarmonyColorPicker composable, to keep both in sync

riggaroo commented 1 year ago

@halilozercan thanks for spotting this - i've made a change in #30 for both pickers