,
@@ -56,7 +55,6 @@ const forwardPropsList = {
children: true,
disabled: true,
focusable: true,
- hitSlop: true,
importantForAccessibility: true,
nativeID: true,
onBlur: true,
diff --git a/packages/react-native-web/src/exports/View/__tests__/__snapshots__/index-test.js.snap b/packages/react-native-web/src/exports/View/__tests__/__snapshots__/index-test.js.snap
index 48dc1be5..0cfddbcf 100644
--- a/packages/react-native-web/src/exports/View/__tests__/__snapshots__/index-test.js.snap
+++ b/packages/react-native-web/src/exports/View/__tests__/__snapshots__/index-test.js.snap
@@ -17,28 +17,6 @@ exports[`components/View non-text is rendered 1`] = `
`;
-exports[`components/View prop "hitSlop" handles partial offsets 1`] = `
-
-
-
-`;
-
-exports[`components/View prop "hitSlop" renders a span with negative position offsets 1`] = `
-
-
-
-`;
-
exports[`components/View prop "pointerEvents" 1`] = `
{
});
});
- describe('prop "hitSlop"', () => {
- test('renders a span with negative position offsets', () => {
- const { container } = render();
- expect(container.firstChild).toMatchSnapshot();
- });
-
- test('handles partial offsets', () => {
- const { container } = render();
- expect(container.firstChild).toMatchSnapshot();
- });
- });
-
test('prop "pointerEvents"', () => {
const { container } = render();
expect(container.firstChild).toMatchSnapshot();
diff --git a/packages/react-native-web/src/exports/View/index.js b/packages/react-native-web/src/exports/View/index.js
index 5e8a81bc..d63c4e25 100644
--- a/packages/react-native-web/src/exports/View/index.js
+++ b/packages/react-native-web/src/exports/View/index.js
@@ -78,23 +78,8 @@ const forwardPropsList = {
const pickProps = props => pick(props, forwardPropsList);
-function createHitSlopElement(hitSlop) {
- const hitSlopStyle = {};
- for (const prop in hitSlop) {
- if (hitSlop.hasOwnProperty(prop)) {
- const value = hitSlop[prop];
- hitSlopStyle[prop] = value > 0 ? -1 * value : 0;
- }
- }
- return createElement('span', {
- classList: [classes.hitSlop],
- style: hitSlopStyle
- });
-}
-
const View = forwardRef((props, forwardedRef) => {
const {
- hitSlop,
onLayout,
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
@@ -131,9 +116,6 @@ const View = forwardRef((props, forwardedRef) => {
}
});
- const children = hitSlop
- ? React.Children.toArray([createHitSlopElement(hitSlop), props.children])
- : props.children;
const classList = [classes.view];
const style = StyleSheet.compose(
hasTextAncestor && styles.inline,
@@ -162,7 +144,6 @@ const View = forwardRef((props, forwardedRef) => {
});
const supportedProps = pickProps(props);
- supportedProps.children = children;
supportedProps.classList = classList;
supportedProps.ref = setRef;
supportedProps.style = style;
@@ -187,16 +168,6 @@ const classes = css.create({
padding: 0,
position: 'relative',
zIndex: 0
- },
- // this zIndex-ordering positions the hitSlop above the View but behind
- // its children
- hitSlop: {
- position: 'absolute',
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- zIndex: -1
}
});
diff --git a/packages/react-native-web/src/exports/View/types.js b/packages/react-native-web/src/exports/View/types.js
index 1c354131..9a2fb1aa 100644
--- a/packages/react-native-web/src/exports/View/types.js
+++ b/packages/react-native-web/src/exports/View/types.js
@@ -8,7 +8,7 @@
* @flow
*/
-import type { ColorValue, EdgeInsetsValue, GenericStyleProp, LayoutEvent } from '../../types';
+import type { ColorValue, GenericStyleProp, LayoutEvent } from '../../types';
import type {
AnimationStyles,
@@ -93,7 +93,6 @@ export type ViewProps = {
},
accessible?: boolean,
children?: ?any,
- hitSlop?: ?EdgeInsetsValue,
importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants',
nativeID?: ?string,
onBlur?: (e: any) => void,