zubairpaizer / react-native-searchable-dropdown

Searchable Dropdown
148 stars 98 forks source link

zero defaultIndex not showing default name #23

Open cicomint opened 5 years ago

cicomint commented 5 years ago

Reproduce <SearchableDropdown defaultIndex={0} items={dataFiltered} />/

mateuszkardas commented 5 years ago

Temporary solution for this is to pass defaultIndex as string

RayhanYulanda commented 5 years ago

Temporary solution for this is to pass defaultIndex as string

yes. exactly. i tried defIndex.toString() to make it works

rayala3892 commented 4 years ago

Did you manage to solve this?

prajna-h commented 4 years ago

Any solution??

prajna-h commented 4 years ago

Temporary solution for this is to pass defaultIndex as string

yes. exactly. i tried defIndex.toString() to make it works

Hey can you tell me how to do it exactly?

mateuszkardas commented 4 years ago

Temporary solution for this is to pass defaultIndex as string

yes. exactly. i tried defIndex.toString() to make it works

Hey can you tell me how to do it exactly?

defaultIndex={"0"} instead of defaultIndex={0}

<SearchableDropdown defaultIndex={"0"} items={dataFiltered} />

and if You have this index in variable then You must convert number to string

const index = 0;
<SearchableDropdown defaultIndex={index.toString()} items={dataFiltered} />
prajna-h commented 4 years ago

Temporary solution for this is to pass defaultIndex as string

yes. exactly. i tried defIndex.toString() to make it works

Hey can you tell me how to do it exactly?

defaultIndex={"0"} instead of defaultIndex={0}

<SearchableDropdown defaultIndex={"0"} items={dataFiltered} />

and if You have this index in variable then You must convert number to string

const index = 0;
<SearchableDropdown defaultIndex={index.toString()} items={dataFiltered} />

I tried but it is not working