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