Skip to content

Commit

Permalink
feat: add onLongPress prop to List.Accordion (#2479)
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-ka committed Jan 5, 2021
1 parent d9790b2 commit d6b30fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/List/ListAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ type Props = {
* Function to execute on press.
*/
onPress?: () => void;
/**
* Function to execute on long press.
*/
onLongPress?: () => void;
/**
* Content of the section.
*/
Expand Down Expand Up @@ -135,6 +139,7 @@ const ListAccordion = ({
id,
testID,
onPress,
onLongPress,
expanded: expandedProp,
}: Props) => {
const [expanded, setExpanded] = React.useState<boolean>(
Expand Down Expand Up @@ -174,6 +179,7 @@ const ListAccordion = ({
<TouchableRipple
style={[styles.container, style]}
onPress={handlePress}
onLongPress={onLongPress}
accessibilityTraits="button"
accessibilityComponentType="button"
accessibilityRole="button"
Expand Down

0 comments on commit d6b30fb

Please sign in to comment.