Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add testID prop and use it for modal handle testID prefix #492

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-modalize",
"version": "2.1.1",
"version": "2.1.2",
"description": "A highly customizable modal/bottom sheet that loves scrolling content.",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const PAN_DURATION = 150;

const ModalizeBase = (
{
// Test
testID,

// Refs
contentRef,

Expand Down Expand Up @@ -671,7 +674,7 @@ const ModalizeBase = (
onHandlerStateChange={handleComponent}
>
<Animated.View style={handleStyles}>
<View style={shapeStyles} />
<View style={shapeStyles} testID={`${testID}_handle_shape`}/>
</Animated.View>
</PanGestureHandler>
);
Expand Down
4 changes: 4 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export interface IConfigProps {
}

export interface IProps<ListItem = any> {
/**
* The testID prefix for all child component
*/
testID?: string;
/**
* A reference to the view (ScrollView, FlatList, SectionList) that provides the scroll behavior, where you will be able to access their owns methods.
*/
Expand Down