Skip to content

Commit

Permalink
feat: add prop pointerEvents for ListAccordion (#3463)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunohkbx authored Dec 19, 2022
1 parent 0fca19f commit f626652
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/List/ListAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
StyleSheet,
TextStyle,
View,
ViewProps,
ViewStyle,
} from 'react-native';

Expand Down Expand Up @@ -90,6 +91,10 @@ export type Props = {
* Accessibility label for the TouchableRipple. This is read by the screen reader when the user taps the touchable.
*/
accessibilityLabel?: string;
/**
* `pointerEvents` passed to the `View` container
*/
pointerEvents?: ViewProps['pointerEvents'];
};

/**
Expand Down Expand Up @@ -153,6 +158,7 @@ const ListAccordion = ({
onLongPress,
expanded: expandedProp,
accessibilityLabel,
pointerEvents = 'none',
}: Props) => {
const [expanded, setExpanded] = React.useState<boolean>(
expandedProp || false
Expand Down Expand Up @@ -204,7 +210,7 @@ const ListAccordion = ({
testID={testID}
borderless
>
<View style={styles.row} pointerEvents="none">
<View style={styles.row} pointerEvents={pointerEvents}>
{left
? left({
color: isExpanded ? theme.colors?.primary : descriptionColor,
Expand Down

0 comments on commit f626652

Please sign in to comment.