halilb / react-native-textinput-effects

Text inputs with custom label and icon animations for iOS and android. Built with react native and inspired by Codrops.
MIT License
2.98k stars 291 forks source link

Prop 'selectTextOnFocus' doesn't work on iOS #124

Open schrulnz opened 3 years ago

schrulnz commented 3 years ago

I want the text of a Kohona element to be selected as soon as the TextInput is klicked. This works fine on Android, but on iOS it doesn't. I already had a look at the Kohona.js file of the library but I couldn't find the problem.

I also tried clearTextOnFocus, this works fine on iOS. Also, if I use a normal RN <TextInput ... />, it works as well.

Some of my dependencies: "react": "16.9.0", "react-native": "0.61.5", "react-native-textinput-effects": "0.6.1",

This is my code:


                    import {Hideo, Kohana, Kaede} from 'react-native-textinput-effects';
                    // ...
                    <Kohana
                        inputStyle={[styles.inputStyle, {color: '#666'}]}
                        labelStyle={styles.label}
                        label={typeOfPoints}
                        labelContainerStyle={{ padding: 5 }}
                        iconClass={AwesomeIcon}
                        iconName={'bar-chart'}
                        iconColor={'#000'}
                        iconContainerStyle={{ padding: 10 }}
                        inputPadding={16}
                        returnKeyType={'done'}
                        keyboardType={'phone-pad'}
                        value={value}
                        onChangeText={(input) => this.setPoints(typeOfPoints, input)}
                        selectTextOnFocus={true}
                        useNativeDriver
                    />