pankod / react-native-picker-modal-view

An unified React Native Picker Modal component for iOS and Android.
204 stars 55 forks source link

Can't see anything on the picker #96

Open dj-ds opened 2 years ago

dj-ds commented 2 years ago

I can't see anything on the picker even after passing the data. This is happening first time I've never seen such issue before.

Screenshot 2022-02-02 at 10 59 06 AM

OS: macOS Monterey Platform: Android React Native version: 0.66.4 react-native-picker-modal-view: "^1.3.2"

atul407 commented 2 years ago

add #000000 in android->app->src->main->res->values->styles.xml under style name AppTheme

mballinas commented 1 year ago

I had the same error and realized that when you enter a search text it shows the results. So the problem is the filter function, is not working with empty text, for now I modified the file: react-native-picker-modal-view/dist/Helpers/index.js so the filter considers the empty text. It looks like this (first part of the return line):

export const getFilteredData = (items, autoSort, searchText) => {
    if (autoSort) {
        items.sort((a, b) => trCompare(a.Name, b.Name));
    }
    return items.filter((l) => {
        return !searchText || l.Name.toLowerCase().indexOf(searchText.toLocaleLowerCase()) > -1
    });
};