@@ -22,7 +22,6 @@ const StyleSheet = require('StyleSheet');
22
22
const Text = require ( 'Text' ) ;
23
23
const TextAncestor = require ( 'TextAncestor' ) ;
24
24
const TextInputState = require ( 'TextInputState' ) ;
25
- const TimerMixin = require ( 'react-timer-mixin' ) ;
26
25
const TouchableWithoutFeedback = require ( 'TouchableWithoutFeedback' ) ;
27
26
const UIManager = require ( 'UIManager' ) ;
28
27
@@ -803,7 +802,7 @@ const TextInput = createReactClass({
803
802
* `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We
804
803
* make `this` look like an actual native component class.
805
804
*/
806
- mixins : [ NativeMethodsMixin , TimerMixin ] ,
805
+ mixins : [ NativeMethodsMixin ] ,
807
806
808
807
/**
809
808
* Returns `true` if the input is currently focused; `false` otherwise.
@@ -819,6 +818,7 @@ const TextInput = createReactClass({
819
818
_focusSubscription : ( undefined : ?Function ) ,
820
819
_lastNativeText : ( undefined : ?string ) ,
821
820
_lastNativeSelection : ( undefined : ?Selection ) ,
821
+ _rafId : ( null : ?AnimationFrameID ) ,
822
822
823
823
componentDidMount : function ( ) {
824
824
this . _lastNativeText = this . props . value ;
@@ -833,7 +833,7 @@ const TextInput = createReactClass({
833
833
'focus' ,
834
834
el => {
835
835
if ( this === el ) {
836
- this . requestAnimationFrame ( this . focus ) ;
836
+ this . _rafId = requestAnimationFrame ( this . focus ) ;
837
837
} else if ( this . isFocused ( ) ) {
838
838
this . blur ( ) ;
839
839
}
@@ -844,7 +844,7 @@ const TextInput = createReactClass({
844
844
}
845
845
} else {
846
846
if ( this . props . autoFocus ) {
847
- this . requestAnimationFrame ( this . focus ) ;
847
+ this . _rafId = requestAnimationFrame ( this . focus ) ;
848
848
}
849
849
}
850
850
} ,
@@ -858,6 +858,9 @@ const TextInput = createReactClass({
858
858
if ( tag != null ) {
859
859
TextInputState . unregisterInput ( tag ) ;
860
860
}
861
+ if ( this . _rafId != null ) {
862
+ cancelAnimationFrame ( this . _rafId ) ;
863
+ }
861
864
} ,
862
865
863
866
contextTypes : {
0 commit comments