Skip to content
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

Fix hidden TextInput on Android/Expo #737

Closed
wants to merge 4 commits into from

Conversation

davista123
Copy link

@davista123 davista123 commented Jan 30, 2018

This pull request is a fix to issue #578, #435 and #680.
Currently, on android the text input is hidden when the keyboard is focused. I provide a fix by leveraging the react-native-keyboard-spacer library. The fix renders only on android/expo as shown below:

renderKeyboardSpacer() {
   if (Platform.OS === 'android') {
      return (<KeyboardSpacer />);
    }
    return null; 
}

@xcarpentier
Copy link
Collaborator

@davista123 Thanks :)
Is that possible to remove this file package-lock.json?
We already using yarn.

@xcarpentier xcarpentier self-requested a review January 30, 2018 09:10
Copy link
Collaborator

@xcarpentier xcarpentier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove package-lock.json

@@ -573,6 +586,7 @@ GiftedChat.propTypes = {
loadEarlier: PropTypes.bool,
onLoadEarlier: PropTypes.func,
isLoadingEarlier: PropTypes.bool,
renderKeyboardSpacer: PropTypes.func,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this props if you don't use it?

renderKeyboardSpacer() not used as props. Redundant code.
@codecov
Copy link

codecov bot commented Feb 21, 2018

Codecov Report

Merging #737 into master will decrease coverage by 0.25%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
- Coverage   42.91%   42.65%   -0.26%     
==========================================
  Files          20       20              
  Lines         501      504       +3     
  Branches      105      106       +1     
==========================================
  Hits          215      215              
- Misses        218      220       +2     
- Partials       68       69       +1
Impacted Files Coverage Δ
src/GiftedChat.js 24.09% <0%> (-0.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75a8ce2...e8723f0. Read the comment docs.

@jeaye
Copy link

jeaye commented Feb 24, 2018

Any update on this one? Having gifted chat do this by default would be great.

@MrGurns
Copy link

MrGurns commented Feb 27, 2018

Subscribing.

@watadarkstar
Copy link
Collaborator

Any updates on this @davista123 @xcarpentier ? What still needs to be done?

@stale
Copy link

stale bot commented Feb 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 12, 2019
@stale stale bot closed this Feb 19, 2019
@camin-mccluskey
Copy link

Any update on this? Currently this library works perfectly on iOS and suffers from this keyboard hiding issue on Android for me. I've tried everything to push the textInput up over the keyboard but nothing has worked.

@SathishSaminathan
Copy link

SathishSaminathan commented Feb 16, 2020

try this..

<View style={{ flex: 1 }}>
    <GiftedChat
        messages={this.state.messages}
        onSend={messages => this.onSend(messages)}
        user={{
            _id: 1,
        }} />
    <KeyboardAvoidingView
        behavior={'padding'}
        keyboardVerticalOffset={80}
    />
</View>

@FromSunNews
Copy link

thử cái này xem sao..

<View style={{flex: 1}}> <GiftedChat messages={this.state.messages} onSend={messages => this.onSend(messages)} user={{ _id: 1, }}>

    <KeyboardAvoidingView
      behavior={'padding'}
      keyboardVerticalOffset={80}
    />
  `</View>`

I appreciate you, thiss work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants