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

Remove touch events and external keyboard dependency #327

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"sync": "rm -rf ./node_modules/react-native-gifted-chat; sane '/usr/bin/rsync -v -a --exclude .git --exclude example --exclude __tests__ --exclude node_modules ../ ./node_modules/react-native-gifted-chat/' .. --glob='{**/*.json,**/*.js}'"
},
"dependencies": {
"react": "15.2.1",
"react-native": "^0.30.0",
"react": "15.3.2",
"react-native": "0.37.0",
"react-native-camera-roll-picker": "^1.1.7",
"react-native-gifted-chat": "file:../",
"react-native-nav": "^1.1.4"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"md5": "^2.1.0",
"moment": "^2.13.0",
"react-native-communications": "^2.1.0",
"react-native-dismiss-keyboard": "^1.0.0",
"react-native-invertible-scroll-view": "^1.0.0",
"react-native-parsed-text": "^0.0.15",
"shallowequal": "^0.2.2"
Expand Down
24 changes: 0 additions & 24 deletions src/GiftedChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from 'react-native';

import ActionSheet from '@exponent/react-native-action-sheet';
import dismissKeyboard from 'react-native-dismiss-keyboard';
import moment from 'moment/min/moment-with-locales.min';

import * as utils from './utils';
Expand Down Expand Up @@ -55,9 +54,6 @@ class GiftedChat extends React.Component {
isInitialized: false, // initialization will calculate maxHeight before rendering the chat
};

this.onTouchStart = this.onTouchStart.bind(this);
this.onTouchMove = this.onTouchMove.bind(this);
this.onTouchEnd = this.onTouchEnd.bind(this);
this.onKeyboardWillShow = this.onKeyboardWillShow.bind(this);
this.onKeyboardWillHide = this.onKeyboardWillHide.bind(this);
this.onKeyboardDidShow = this.onKeyboardDidShow.bind(this);
Expand All @@ -68,10 +64,6 @@ class GiftedChat extends React.Component {

this.invertibleScrollViewProps = {
inverted: true,
keyboardShouldPersistTaps: true,
onTouchStart: this.onTouchStart,
onTouchMove: this.onTouchMove,
onTouchEnd: this.onTouchEnd,
onKeyboardWillShow: this.onKeyboardWillShow,
onKeyboardWillHide: this.onKeyboardWillHide,
onKeyboardDidShow: this.onKeyboardDidShow,
Expand Down Expand Up @@ -265,22 +257,6 @@ class GiftedChat extends React.Component {
});
}

onTouchStart() {
this._touchStarted = true;
}

onTouchMove() {
this._touchStarted = false;
}

// handle Tap event to dismiss keyboard
onTouchEnd() {
if (this._touchStarted === true) {
dismissKeyboard();
}
this._touchStarted = false;
}

renderMessages() {
const AnimatedView = this.props.isAnimated === true ? Animated.View : View;
return (
Expand Down
1 change: 0 additions & 1 deletion src/MessageContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export default class MessageContainer extends React.Component {
<View ref='container' style={{flex:1}}>
<ListView
enableEmptySections={true}
keyboardShouldPersistTaps={true}
automaticallyAdjustContentInsets={false}
initialListSize={20}
pageSize={20}
Expand Down