mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-07 20:21:25 +00:00
Remove pointerEvents code from View
This commit is contained in:
@@ -33,7 +33,6 @@ class View extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
pointerEvents,
|
|
||||||
style,
|
style,
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
collapsable,
|
collapsable,
|
||||||
@@ -49,12 +48,7 @@ class View extends Component {
|
|||||||
const { isInAButtonView } = this.context;
|
const { isInAButtonView } = this.context;
|
||||||
const isButton = getAccessibilityRole(this.props) === 'button';
|
const isButton = getAccessibilityRole(this.props) === 'button';
|
||||||
|
|
||||||
otherProps.style = [
|
otherProps.style = [styles.initial, isButton && styles.buttonOnly, style];
|
||||||
styles.initial,
|
|
||||||
isButton && styles.buttonOnly,
|
|
||||||
style,
|
|
||||||
pointerEvents && pointerEventStyles[pointerEvents]
|
|
||||||
];
|
|
||||||
|
|
||||||
const component = isInAButtonView ? 'span' : 'div';
|
const component = isInAButtonView ? 'span' : 'div';
|
||||||
return createDOMElement(component, otherProps);
|
return createDOMElement(component, otherProps);
|
||||||
@@ -91,19 +85,4 @@ const styles = StyleSheet.create({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const pointerEventStyles = StyleSheet.create({
|
|
||||||
auto: {
|
|
||||||
pointerEvents: 'auto'
|
|
||||||
},
|
|
||||||
'box-none': {
|
|
||||||
pointerEvents: 'box-none'
|
|
||||||
},
|
|
||||||
'box-only': {
|
|
||||||
pointerEvents: 'box-only'
|
|
||||||
},
|
|
||||||
none: {
|
|
||||||
pointerEvents: 'none'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = applyLayout(applyNativeMethods(View));
|
module.exports = applyLayout(applyNativeMethods(View));
|
||||||
|
|||||||
Reference in New Issue
Block a user