-
Notifications
You must be signed in to change notification settings - Fork 646
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
Component Not working with react-native 0.63 #443
Comments
I have forked the repo to fix this issue.
|
Thanks @codler :) i have tested - its rendering 👍 but not scrolling ;) any special params need to passed? Good job <3 |
@meabed I just used the forked repo in my project and everything is working fine. Maybe is something to do with one of the children in the view. |
Thanks a lot :) it works like a charm - I was missing some flex styles 😀 |
is this repo dead we need to move to fork ? |
@lukasa1993 nope, just starting to help with it :) |
how can we help? |
@lukasa1993 can you test master with RN 0.63 (I didn't upgrade yet my project) and if it works I'll push for an npm publish :) I just merged #442 |
it wasnt pushed to npm |
@lukasa1993 I know, you need to install the git version |
@codler added a few commits to his forked repo. Would be good to get all his changes in |
@codler whenever you want, please make a PR :) |
Hmm in my implementation seems |
Its not available on npm. How to use the latest 0.9.2 version ? |
|
@bhirave I don't have rights to publish, we need to wait for @alvaromb |
any updates on this? This feels like a perfect example of why you assign more than one who can publish. |
Any updates? |
Please publish to NPM!! |
Any updates? |
Any updates ? |
why this took so long any problems? |
If I understand correctly, there's only one person who have the right to publish to npm, and he's not available for the moment. If you really want to use the latest release, you could just target the tag in your package.json. |
well i am but still strange :D |
I have moved away from this component and are using the one that comes directly from react-native instead since for me this has become a liability issue and I made my own keyboard avoid component that works really great. I have used this component that the author did and I liked for a long time so shout out to the author. |
No update on npm ? |
Still no update on npm ? |
I have the same issue, could you update npm asap please ? |
I don't think to spam the comments will make the author fix this faster. Just have some patience guys |
We were able to completely remove this dependency in latest RN just by wrapping any ScrollView in KeyboardAvoidingView. This is working beautifully and got rid of longstanding bugs we had with this library. The only real trick was ensuring header height is accounted for, which can be done this way if using import { useHeaderHeight } from "@react-navigation/stack";
export function useKeyboardAvoidingViewProps(): KeyboardAvoidingViewProps {
const headerHeight = useHeaderHeight();
return {
behavior: "padding",
// https://stackoverflow.com/questions/48420468/keyboardavoidingview-not-working-properly
keyboardVerticalOffset: headerHeight,
};
} Then just spread those props into |
Using @codler's fork, the component does render for me, but when I try to use the ref.props methods, props is undefined. What is going on here? |
Seems possibly related to RN 0.63 change: |
downgrade RN version will be fastest solution 🤣 |
@putupadang It's true. lmao |
any update????? please help |
honestly, you don't need this library at all. I created my own component that works like a charm so create two components create a file called import React from 'react';
import { KeyboardAvoidingView, Platform, KeyboardAvoidingViewProps } from 'react-native';
interface IKeyboardAvoid extends KeyboardAvoidingViewProps {
children: React.ReactNode;
}
const KeyboardAvoid = ({ children }: IKeyboardAvoid) => {
return (
<KeyboardAvoidingView
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
style={{
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
backgroundColor: '#ffffff',
flex: 1
}}
>
{children}
</KeyboardAvoidingView>
);
};
export default KeyboardAvoid; then create another file called import React from 'react';
import styled from 'styled-components/native';
import { ViewProperties, ScrollView } from 'react-native';
interface IContainerProps extends ViewProperties {
children: React.ReactNode;
bgColor?: string;
}
const Container = styled.View`
display: flex;
flex-direction: column;
justify-content: center;
flex: 1;
background-color: ${(props: IContainerProps) => (props.bgColor ? props.bgColor : '#ffffff')};
`;
const RootContainer = ({ bgColor, children, ...rest }: IContainerProps) => {
return (
<ScrollView
keyboardShouldPersistTaps="handled"
keyboardDismissMode="on-drag"
contentContainerStyle={{
display: 'flex',
flexGrow: 1,
justifyContent: 'center'
}}
>
<Container bgColor={bgColor} {...rest}>
{children}
</Container>
</ScrollView>
);
};
export default RootContainer; Then for every new screen that you make you just need to add the then you need to add the |
Thanks @CyrusZei , it works ! 🎉 Just a suggestion : the line |
Yeah true, removed it from the wrong place 😂 |
In case someone missed it, 0.9.2 has now been published to npm (https://www.npmjs.com/package/react-native-keyboard-aware-scroll-view/v/0.9.2). Seems to work for me with rn 0.63.2 |
Yeah, that makes a lot of sense. Also calling the methods directly on the ref without the However as far as I understood |
another simple solution that could be a good alternative for using this library and needs no external dependency :
|
Did you just make a hooks keyboard 😁
On Sun, 16 Aug 2020 at 13:46, kholood ***@***.***> wrote:
another simple solution that could be a good alternative for using this
library and needs no external dependency :
import {Keyboard,KeyboardAvoidingView,TouchableWithoutFeedback} from
'react-native';
const [shiftkeyboard, setShiftkeyboard] = React.useState(false);
//wrap the whole component screen with this
return(
<>
<TextInput
style={......}
keyboardType="phone-pad"
placeholder="......."
onFocus={() => setShiftkeyboard(true)}
/>
</>
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#443 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGR3T3EFYUSCHEGEUTJO53SA7BKJANCNFSM4OXZUW7A>
.
--
With regards
Cyrus_Zei
[ *Developer* + *Designer* = *Unicorn*]
|
thanks for making me realize my comment is displayed wrong 😅, good solution up there 👍🏻 |
@CyrusZei |
|
I highly doubt this works like a charm. Here is a screenshot of a KeyboardAvoidingView on Android (Pixel 4, API 29, android:softInputMode:adjustResize) You can clearly see KAV is not taking into account the software nav buttons. |
@wmonecke On iOS it worked great and with listening for On Android it "works" with the mentioned configs, like setting My main problem is that I would love to somehow get the |
Anybody does know exactly why it doesnt work in Android with the latest (0.93) release? Is it because of the indowSoftInputMode or some other setting? Neither the native KeyboardAvoidingView works as well in both platforms for some reason. |
v0.9.2 worked and our form showed up again |
Hello everyone, Just created a hook to handle keyboard input like this lib does, but working more efficiently with bottom tabs, and even if ScrollView is not in full screen, feel free to take a look:
|
Hey!
First thank you for the awesome component 🙏
Then :)
After upgrading to latest react-native 0.63 - it stopped rendering at all - when downgrading back works fine - I am not sure it could be something with the deprecation of react-native apis.
It would great if this could fixed soon 👍
Thank you again ❤️
The text was updated successfully, but these errors were encountered: