mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Updates from Thu Mar 12
- Fixed sticky section headers in ListView | Nick Lockwood - [ReactNative] AppState cleanup, remove Subscribable, add in OSS examples | Eric Vicenti - [react-packager] package.json cleanup (seperate packager into it's own package) | Amjad Masad - [ReactNative] Move PushNotificationIOS to oss | Tadeu Zagallo - [ReactNative] Fix shake gesture after RedBox is dismissed | Alex Kotliarskyi - [catlyst|madman] fix prop type warning | Jiajie Zhu - [ReactNative] Remove Subscribable from TextInput | Eric Vicenti - Unforked ExceptionsManager, AlertManager and AppState | Nick Lockwood - [ReactNative|MAdMan] Notification Subscribable | Eric Vicenti - [ReactNative] OSS AsyncStorage with example | Spencer Ahrens
This commit is contained in:
@@ -401,8 +401,8 @@ var ListView = React.createClass({
|
||||
var header = this.props.renderHeader && this.props.renderHeader();
|
||||
var totalIndex = header ? 1 : 0;
|
||||
var visibilityChanged = false;
|
||||
var changedRows = {};
|
||||
for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {
|
||||
var changedRows = {};
|
||||
for (var sectionIdx = 0; sectionIdx < allRowIDs.length; sectionIdx++) {
|
||||
var rowIDs = allRowIDs[sectionIdx];
|
||||
if (rowIDs.length === 0) {
|
||||
continue;
|
||||
|
||||
@@ -310,8 +310,8 @@ var validAttributes = {
|
||||
alwaysBounceVertical: true,
|
||||
automaticallyAdjustContentInsets: true,
|
||||
centerContent: true,
|
||||
contentInset: insetsDiffer,
|
||||
contentOffset: pointsDiffer,
|
||||
contentInset: {diff: insetsDiffer},
|
||||
contentOffset: {diff: pointsDiffer},
|
||||
decelerationRate: true,
|
||||
horizontal: true,
|
||||
keyboardDismissMode: true,
|
||||
@@ -321,11 +321,11 @@ var validAttributes = {
|
||||
pagingEnabled: true,
|
||||
removeClippedSubviews: true,
|
||||
scrollEnabled: true,
|
||||
scrollIndicatorInsets: insetsDiffer,
|
||||
scrollIndicatorInsets: {diff: insetsDiffer},
|
||||
scrollsToTop: true,
|
||||
showsHorizontalScrollIndicator: true,
|
||||
showsVerticalScrollIndicator: true,
|
||||
stickyHeaderIndices: deepDiffer,
|
||||
stickyHeaderIndices: {diff: deepDiffer},
|
||||
throttleScrollCallbackMS: true,
|
||||
zoomScale: true,
|
||||
};
|
||||
|
||||
@@ -14,7 +14,6 @@ var React = require('React');
|
||||
var ReactChildren = require('ReactChildren');
|
||||
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var Subscribable = require('Subscribable');
|
||||
var Text = require('Text');
|
||||
var TextInputState = require('TextInputState');
|
||||
var TimerMixin = require('TimerMixin');
|
||||
@@ -195,7 +194,7 @@ var TextInput = React.createClass({
|
||||
* `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
|
||||
* make `this` look like an actual native component class.
|
||||
*/
|
||||
mixins: [NativeMethodsMixin, TimerMixin, Subscribable.Mixin],
|
||||
mixins: [NativeMethodsMixin, TimerMixin],
|
||||
|
||||
viewConfig: {
|
||||
uiViewClassName: 'RCTTextField',
|
||||
@@ -232,18 +231,25 @@ var TextInput = React.createClass({
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.addListenerOn(this.context.focusEmitter, 'focus', (el) => {
|
||||
if (this === el) {
|
||||
this.requestAnimationFrame(this.focus);
|
||||
} else if (this.isFocused()) {
|
||||
this.blur();
|
||||
this._focusSubscription = this.context.focusEmitter.addListener(
|
||||
'focus',
|
||||
(el) => {
|
||||
if (this === el) {
|
||||
this.requestAnimationFrame(this.focus);
|
||||
} else if (this.isFocused()) {
|
||||
this.blur();
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
if (this.props.autoFocus) {
|
||||
this.context.onFocusRequested(this);
|
||||
}
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this._focusSubscription && this._focusSubscription.remove();
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(newProps) {
|
||||
if (newProps.value !== this.props.value) {
|
||||
if (!this.isFocused()) {
|
||||
|
||||
Reference in New Issue
Block a user