mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-20 05:31:28 +00:00
[fix] iOS Touchable click handling
This commit is contained in:
@@ -247,7 +247,7 @@ var TouchableHighlight = React.createClass({
|
||||
onResponderRelease={this.touchableHandleResponderRelease}
|
||||
onResponderTerminate={this.touchableHandleResponderTerminate}
|
||||
ref={UNDERLAY_REF}
|
||||
style={this.state.underlayStyle}
|
||||
style={[ styles.root, this.state.underlayStyle ]}
|
||||
tabIndex='0'
|
||||
testID={this.props.testID}>
|
||||
{React.cloneElement(
|
||||
|
||||
@@ -19,6 +19,7 @@ var Touchable = require('./Touchable');
|
||||
var View = require('../View');
|
||||
var ensurePositiveDelayProps = require('./ensurePositiveDelayProps');
|
||||
var warning = require('fbjs/lib/warning');
|
||||
var StyleSheet = require('../../apis/StyleSheet');
|
||||
|
||||
type Event = Object;
|
||||
|
||||
@@ -160,8 +161,8 @@ const TouchableWithoutFeedback = React.createClass({
|
||||
children.push(Touchable.renderDebugView({color: 'red', hitSlop: this.props.hitSlop}));
|
||||
}
|
||||
const style = (Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text') ?
|
||||
[child.props.style, {color: 'red'}] :
|
||||
child.props.style;
|
||||
[styles.root, child.props.style, {color: 'red'}] :
|
||||
[styles.root, child.props.style];
|
||||
return (React: any).cloneElement(child, {
|
||||
accessible: this.props.accessible !== false,
|
||||
accessibilityLabel: this.props.accessibilityLabel,
|
||||
@@ -182,4 +183,10 @@ const TouchableWithoutFeedback = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
root: {
|
||||
cursor: 'pointer'
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = TouchableWithoutFeedback;
|
||||
|
||||
Reference in New Issue
Block a user