Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ yarn.lock
.vscode/
lib/
.watchmanconfig

/.history
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "react-native-modalize",
"version": "2.1.1",
"name": "react-native-modalize-x2",
"version": "2.1.7",
"description": "A highly customizable modal/bottom sheet that loves scrolling content.",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"build": "rm -rf ./lib/* && yarn lint && tsc",
"prepare": "yarn build",
"prepare": "yarn tsc",
"lint": "eslint 'src/**/*.ts?(x)' && prettier --list-different \"**/*.{json,md,js,jsx,ts,tsx}\"",
"prettier": "prettier --write \"{docs,examples,src}/**/*.{json,md,js,jsx,ts,tsx}\"",
"postversion": "sh ./post-version.sh",
Expand Down Expand Up @@ -60,12 +60,6 @@
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"devDependencies": {
"@commitlint/cli": "9.1.2",
"@commitlint/config-conventional": "9.1.2",
Expand Down
18 changes: 11 additions & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const ModalizeBase = (
dragToss = 0.18,
threshold = 120,
velocity = 2800,
closeVelocity = 250,
panGestureAnimatedValue,
useNativeDriver = true,

Expand Down Expand Up @@ -292,8 +293,8 @@ const ModalizeBase = (
easing: timing.easing,
useNativeDriver: USE_NATIVE_DRIVER,
}),
]).start(() => {
if (onOpened) {
]).start(({finished}) => {
if (onOpened && finished) {
onOpened();
}

Expand Down Expand Up @@ -530,12 +531,14 @@ const ModalizeBase = (
handleClose();
}
} else {
destSnapPoint = snap;
willCloseModalize = false;
if(cancelTranslateY && toValue > closeVelocity) {
destSnapPoint = snap;
willCloseModalize = false;

if (snap === endHeight) {
willCloseModalize = true;
handleClose();
if (snap === endHeight) {
willCloseModalize = true;
handleClose();
}
}
}
}
Expand Down Expand Up @@ -795,6 +798,7 @@ const ModalizeBase = (
ref={nativeViewChildrenRef}
waitFor={tapGestureModalizeRef}
simultaneousHandlers={panGestureChildrenRef}
enabled={panGestureEnabled}
>
{renderContent()}
</NativeViewGestureHandler>
Expand Down
1 change: 1 addition & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface IConfigProps {
}

export interface IProps<ListItem = any> {
closeVelocity?: number;
/**
* 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