Open prajna-h opened 3 years ago
Hello, i fix this problem doing this:
in this line: (/node_modules/react-native-searchable-dropdown)
{ key: 'value', val: this.state.item ? this.state.item.name : '' },
Change to:
{ key: 'value', val: this.state.item ? this.state.item.name : this.state.item },
i recommend u copy the file and pass to src/components to avoid update and reset your changes
anyone found the solution. @Cristiano1103 I could not make it work either by that change.
@Munish-GitHub i changed , i`m using now UI Kitten, witch offers Select but without search. Works very good.
this solution is only for Apple, i tested in my android and didin't work. And have a lot of bugs. Try UI Kitten
My solution was to check if item i clicked use place holder to replace eg: placeholder ={this.state.carBrand=="" ?'Select Brand': this.state.carBrand}
@Munish-GitHub i changed , i`m using now UI Kitten, witch offers Select but without search. Works very good.
this solution is only for Apple, i tested in my android and didin't work. And have a lot of bugs. Try UI Kitten
Yea Autocomplete in UI Kitten has some positioning bugs for android
My solution was to check if item i clicked use place holder to replace eg: placeholder ={this.state.carBrand=="" ?'Select Brand': this.state.carBrand}
LOL what a work around buddy, works like a charm
I fixed the issue with commenting this line. because i console 'this.props.selectedItems' it returns undefined.
return (
<TextInput
{...textInputProps}
onBlur={(e) => {
if (this.props.onBlur) {
this.props.onBlur(e);
}
if (this.props.textInputProps && this.props.textInputProps.onBlur) {
this.props.textInputProps.onBlur(e);
}
// this.setState({ focus: false, item: this.props.selectedItems }); // comment this line
}
}
/>
My solution was to check if item i clicked use place holder to replace eg: placeholder ={this.state.carBrand=="" ?'Select Brand': this.state.carBrand}
Saved my day
@Cristiano1103 his solution work for me nice! but it work only in IOS
My solution was to check if item i clicked use place holder to replace eg: placeholder ={this.state.carBrand=="" ?'Select Brand': this.state.carBrand}
This can even be made better by using the placeholderTextColor
property for example
onItemSelect={(item) => setCarBrand(item.name)}
placeholder={car}
placeholderTextColor={car === "Default car value" ? color.palette.lightGrey : color.palette.black}