mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
Scroll multiline textinputs when focused
Summary: Currently, text inputs do not scroll when inside other components like scroll views. This fixes it by blocking any parent native component from taking the responder when the text input is focused and is being scrolled. This fixes the previous implementation, where the scroll view was not able to scroll on top of other text inputs, even though they were not focused. This makes the component similar to it's ios counterpart. Reviewed By: foghina Differential Revision: D3735237 fbshipit-source-id: 0e56b2bbd3f5636540b4c3cc7cc13aa0f4d2737e
This commit is contained in:
committed by
Facebook Github Bot 2
parent
049639cfdd
commit
0082517a6c
@@ -691,6 +691,7 @@ const TextInput = React.createClass({
|
||||
<TouchableWithoutFeedback
|
||||
onLayout={this.props.onLayout}
|
||||
onPress={this._onPress}
|
||||
shouldBlockResponder={this.isFocused}
|
||||
accessible={this.props.accessible}
|
||||
accessibilityLabel={this.props.accessibilityLabel}
|
||||
accessibilityComponentType={this.props.accessibilityComponentType}
|
||||
|
||||
@@ -396,6 +396,7 @@ var TouchableMixin = {
|
||||
this._handleLongDelay.bind(this, e),
|
||||
longDelayMS + delayMS
|
||||
);
|
||||
return this.props.shouldBlockResponder && this.props.shouldBlockResponder();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user