Skip to content

Double click feature for 'Pressable' component #4636

@serhanozcan

Description

@serhanozcan

Description

As I mentioned in the title, it would be nice to add a double-tap/double-click feature for the pressable component. In this way, extra features can be added for many components.

Problem Statement

For example, when we create a card component, we can use it for different operations with the double-click feature for this card. Like open the menu, add to favorites or text copy to clipboard. Maybe this can be avoided writing extra code or using extra packages.

Proposed Solution or API

<Pressable 
  onPress={()=>oneTapFunction()}
  doublePress={()=>doubleTapFunction()}>
    {children}
</Pressable>

Or

<Box 
  onPress={()=>oneTapFunction()}
  doublePress={()=>doubleTapFunction()}>
    {children}
</Box>

Or

<DoubleTap 
  onPress={()=>oneTapFunction()}
  doublePress={()=>doubleTapFunction()}>
    {children}
</DoubleTap>

Alternatives

No response

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions