react-native-dropdown-picker
react-native-dropdown-picker copied to clipboard
Category Parent sorts items reversed
NOTE The items don't need to be sorted, This will be done automatically.
However, this sort is reversed. My items are sorted from Z-A.
Anyone figure out the code to reverse this? using the npm installation if possible.
Not sure exactly what the code is doing here but the results of a grep -ri sort src/ results in this chunk of code as the only place in the entire codebase that is using the string 'sort'
https://github.com/hossein-zare/react-native-dropdown-picker/blob/51e08081a6cde261667fabe3f980300a3a888e8d/src/components/Picker.js#L309-L365
If you have never seen https://github.com/ds300/patch-package - you should check it out. It means that you can just reach right into node_modules, hack around (adding debug statements or whatever to trace the code and understand it, solve your problem etc) and your work may be preserved across npm/yarn installs and in source control for your colleagues.
If you determine there is some issue here patch-package also helps you file a PR so it is then fixed in the next official version
Yes, I am having the same issue. And with a little testing, have discovered that the sort simply reverses the order, it does not sort anything...
Items are still sorted from Z-A
Have you found a work around?
This issue still seems to occur. I'm going to go about a temporary solution and reverse my input list.
This only seems to affect child items, not the parent or items with no parent. A simple arr.reverse() before building out the child schema solves the issue and can be easily removed in the future.