Skip to content

Commit

Permalink
feat: Allow pointerEvents prop to pass through to containing view (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
META-DREAMER authored and bradbumbalough committed Nov 19, 2019
1 parent 8448370 commit 76397fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ActionSheet/index.ios.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import * as React from 'react';
import { ActionSheetIOS, View } from 'react-native';
import { ActionSheetIOS, View, ViewProps } from 'react-native';
import { ActionSheetIOSOptions } from '../types';

interface Props {
readonly children: React.ReactNode;
readonly pointerEvents?: ViewProps['pointerEvents'];
}

type onSelect = (buttonIndex: number) => void;

export default class ActionSheet extends React.Component<Props> {
render() {
return <View style={{ flex: 1 }}>{React.Children.only(this.props.children)}</View>;
return (
<View pointerEvents={this.props.pointerEvents} style={{ flex: 1 }}>
{React.Children.only(this.props.children)}
</View>
);
}

showActionSheetWithOptions(options: ActionSheetIOSOptions, onSelect: onSelect) {
Expand Down
3 changes: 3 additions & 0 deletions src/ActionSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
StyleSheet,
TouchableWithoutFeedback,
View,
ViewProps,
} from 'react-native';
import ActionGroup from './ActionGroup';
import { ActionSheetOptions } from '../types';
Expand All @@ -21,6 +22,7 @@ interface State {

interface Props {
readonly useNativeDriver: boolean | undefined;
readonly pointerEvents?: ViewProps['pointerEvents'];
}

const OPACITY_ANIMATION_IN_TIME = 225;
Expand Down Expand Up @@ -64,6 +66,7 @@ export default class ActionSheet extends React.Component<Props, State> {
) : null;
return (
<View
pointerEvents={this.props.pointerEvents}
style={{
flex: 1,
}}>
Expand Down

0 comments on commit 76397fa

Please sign in to comment.