Реагировать на собственный TextInput на iOS скрывает клавиатуру после одного нажатия клавиши - PullRequest
0 голосов
/ 12 февраля 2020

импорт React из 'реакции'; import {TextInput, KeyboardAvoidingView, StyleSheet} из'act-native ';

импорт цветов из' ../constants/Colors';

const QaTextInput = ({style, minWidth, maxWidth, placeholder}) => {const input = {height: 35, minWidth: minWidth, maxWidth: maxWidth, borderWidth: 1, borderColor: Colors.input, backgroundColor: Colors.input};

return (
    <KeyboardAvoidingView
        behavior="position"
        keyboardVerticalOffset="100"
        enabled>
        <TextInput
            placeholder={placeholder}
            autoFocus={true}
            showSoftInputOnFocus={true}
            style={input}
        />
    </KeyboardAvoidingView>
);

};

экспорт по умолчанию QaTextInput;

1 Ответ

0 голосов
/ 12 февраля 2020

Это было то, как я использовал компонент. Один из родителей был текстовым узлом. Изменение этого в Вид решило это.

...