react-native-dropdown-picker icon indicating copy to clipboard operation
react-native-dropdown-picker copied to clipboard

BadgeDotColors aren't deterministic

Open ghost opened this issue 2 years ago • 3 comments

Seems like they change quite randomly actually, for example if you pass three possible items, and select all three - two of them may be the same badge dot color despite passing through three badgeDotColors.

Was this the intended functionality? Ideally we should be able to define the individual badge dot color for each item in items

ghost avatar Mar 04 '23 22:03 ghost

Was this the intended functionality?

Not randomly, Based on ASCII Code.

Ideally we should be able to define the individual badge dot color for each item in items

You can add the feature and submit a PR.

hossein-zare avatar Mar 09 '23 19:03 hossein-zare

Yeah, I am also trying to use the badgeDotColors and find it the ASCII code mapping to be not very intuitive.

For my use-case, each item's value is a UUID string. Adding together the ascii code values for each character in the item.value string is kind of meaningless, and could cause collisions.

Maybe the badgeDotColors prop could be a Map<string, string>, mapping item value to a hex code. Or the prop could simply be a callback function that the user could define and pass to it.

yaylinda avatar Jul 01 '23 04:07 yaylinda

I tried to modify the code to just view colors same order as the array but its not working as it should be 🥲... have you guys found any solution to this?

bahaaTuffaha avatar Sep 27 '23 17:09 bahaaTuffaha