Comments (7)
@AromdeSalaxy yes, I had the same problem, just move everything you have under <KeyboardAccessoryView
including the TextInput
to the separate component/file and use setState
there - only that component will be re-rendered.
from react-native-keyboard-accessory-view.
@demchenkoalex thank you so much
from react-native-keyboard-accessory-view.
Hi @AromdeSalaxy
Can you please elaborate? KeyboardAccessoryView just renders children, it does not contain any logic for opening or closing the keyboard. What setState do you mean?
from react-native-keyboard-accessory-view.
const RenderCommentInput = () => {
return (
<View style={styles.postCommentContainer}>
<TextInput
style={styles.inputPostCom}
multiline
numberOfLines={10}
// onChangeText={onMessageChange}
value={message}
onChangeText={setMessage}
/>
</View>
);
};
return (
<SafeAreaView style={styles.safeAreaView}>
<Header title={t('Comment')} />
<KeyboardAccessoryView
renderScrollable={renderScrollable}
children={<RenderCommentInput />}
/>
</SafeAreaView>
);
it happened when i call
value={message}
onChangeText={setMessage}
from react-native-keyboard-accessory-view.
i guess view is re-render inside KeyboardAccessoryView children
from react-native-keyboard-accessory-view.
I have a similar setup in the project and it doesn't close the keyboard, I will try to re-create your code and see what's going on
from react-native-keyboard-accessory-view.
const RenderScrollable = () => (
<FlatList
ref={refList}
keyboardDismissMode="interactive"
data={comments}
{...PanGestureHandler}
ListHeaderComponent={<RenderOwnerPost post={post} profile={profile} />}
renderItem={({ item, index }) => {
return <RenderCommentCard key={item.id} comment={item} />;
}}
contentContainerStyle={{ paddingVertical: 16, paddingBottom: 50 }}
keyExtractor={(item) => item.id.toString()}
/>
);
return (
<SafeAreaView style={styles.safeAreaView}>
<Header title={t('Comment')} />
<KeyboardAccessoryView renderScrollable={RenderScrollable}>
<View style={styles.postCommentContainer}>
<View style={styles.postComInputContainer}>
<TextInput
style={styles.inputPostCom}
multiline
numberOfLines={10}
value={message}
onChangeText={setMessage}
/>
</View>
<View style={styles.btnSend}>
<TouchableOpacity onPress={() => sendComment({ id: profile.id })}>
<Icon.SendCircleFilled width={24} height={24} />
</TouchableOpacity>
</View>
</View>
</KeyboardAccessoryView>
</SafeAreaView>
);
this code keyboard not dismiss
but renderScrollable will re-render when TextInput call onChangeText
from react-native-keyboard-accessory-view.
Related Issues (14)
- Keybard not showing on iPhone 8 HOT 2
- Renders on top of SafeAreaView HOT 2
- Problem rendering background HOT 5
- Why not use the Animated API? HOT 8
- Scrollable cannot be set to fill entire height of container HOT 4
- FlatList keeps scrolling while being dismissed HOT 15
- When I input return, textinput is not follow my cursor HOT 7
- scroll over the keyboard with textinput HOT 2
- iOS negative keyboard height HOT 2
- got animate terrible in my project HOT 1
- Tab Bar issue HOT 5
- Usage with KeyboardAvoidingView and ScrollView? HOT 5
- Doesn't work on android HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-keyboard-accessory-view.