-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blank space beneath KeyboardToolbar after switching from emoji to text keyboard #622
Comments
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-10-09.at.13.49.39.mp4@RobertPetricevic I just tested and it works fine. Would you mind to elaborate a little bit more on:
|
@kirillzyusko, sorry I erased half of my content and video when I was pasting the code.
|
Thank you @RobertPetricevic 🙌 The video definitely looks strange. I can recommend you to try to 1.12.x version or even 1.11.x, but I think all of them will have the same problem 🤷♂️ Curious to see repo configuration and try to reproduce it on my end! |
@RobertPetricevic have you tried to reproduce this problem in isolated environment? 👀 |
@kirillzyusko uhhh hi sorry I'll try it by the end of the week for sure, don't close issue yet :) |
Okay, sure 🙌 |
@RobertPetricevic can you share a full code sample (including styles)? Do you see a toolbar when keyboard is closed? You can adjust the space between |
@kirillzyusko here is the repo: https://github.com/RobertPetricevic/rnkc-test sorry I'm slow again.... I don't see the toolbar when keyboard is closed |
@RobertPetricevic can you check if #702 fixes the problem? I used this code and it fixed the problem: // app/(tabs)/settings/index.js
import { View, Text, TextInput, Button, StyleSheet, Platform } from 'react-native';
import { useRouter } from 'expo-router';
import { KeyboardToolbar, KeyboardAwareScrollView } from 'react-native-keyboard-controller';
export default function SettingsScreen() {
const router = useRouter();
const height = 80; // but better to use https://reactnavigation.org/docs/bottom-tab-navigator/#usebottomtabbarheight
return (
<>
<KeyboardAwareScrollView
style={{
paddingTop: 100,
}}>
<Text style={styles.heading}>Settings Screen</Text>
<TextInput placeholder="Input 1" style={styles.input} />
<TextInput placeholder="Input 2" style={styles.input} />
<Button title="Go to Second" onPress={() => router.push('/two/second')} />
</KeyboardAwareScrollView>
<KeyboardToolbar offset={{closed: height, opened: height}} />
</>
);
}
const styles = StyleSheet.create({
heading: { fontSize: 24, marginBottom: 16 },
input: {
width: '80%',
padding: 10,
marginVertical: 8,
borderWidth: 1,
borderColor: '#ddd',
borderRadius: 5,
},
}); You need to install the dependency from the branch that I used in PR (or apply a patch). |
@RobertPetricevic I believe the problem should be fixed - I tested and merged the PR. However if you discover any new issues - feel free to adjust your reproduction example, drop a message here and I'll re-open the issue. Thank you for the collaboration and your effort put into improvement this library 😊 ❤️ |
@kirillzyusko hi, so this new prop should be in the next release right? |
Yes @RobertPetricevic 😀 Hopefully I can drop 1.15.0 soon (maybe in 1-2 weeks) |
great @kirillzyusko thanks for effort, quick responses and of course, for this library 😊 |
Hi @kirillzyusko, this gap between the toolbar and keyboard, as well as my initial bug, is now fixed with the use of "offset" props, thanks once more :) I'll add a comment here with two more questions, and later, if you want, I can open an issue for them. If it turns out they are really bugs connected to this library, the course So, let's begin with the one that is not a bug of this library for sure, but I would like to ask your opinion on this. I have initialized new project without your library and the bug is still there. VID_20241202_164618.mp4The second bug is this: if on both screens in the stack navigator I have KeyboardToolbar, on going back, I will, in the background, have a toolbar that is being dismissed as navigating back. I'm not sure what am I doing wrong. ScreenRecording_12-02-2024.16-47-21_1.MP4There's no much additional code, I just have a commit in which I have added secureEntry props |
It's definitely a bug. It basically happens because I animate two const isFocused = useIsFocused();
<KeyboardToolbar enabled={isFocused} /> In this case we'll animate only view that currently visible on the screen (it'll also improve performance a little bit, since we'll animate only one element instead of N-elements). Please, create an issue for that and I'll add a new prop (or if you want you can add this property yourself and open a PR). Regarding second bug - does it happen only if you switch focus from |
@kirillzyusko quick again :) okay I get it, I'll open a separate issue thanks :) for the second bug - yes delay is visible when I switch focus from |
Got it Well, I can not recommend anything - I don't know why such delay happens 🤔 I think I saw such delays in example app as well, but as you said earlier - if it's reproducible without keyboard-controller, then it means that the problem is somewhere in react-native itself. You can try to profile the app using XCode tools - maybe they can give any insights into what's going wrong. Or open an issue in react-native repository 🙂 |
Yes, it is definitely something with the react-native itself. Thanks once more @kirillzyusko |
Describe the bug
On clicking input field, keyboard and keyboard toolbar is working fine. If I switch to emoji keyboard and then come back, there is blank space between keyboard and toolbar.
Code snippet
Smartphone (please complete the following information):
Device:
Libraries:
The text was updated successfully, but these errors were encountered: