Skip to content

Commit d9d5aae

Browse files
committed
fix: onPositionChange not correct #209
1 parent c163f0c commit d9d5aae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/index.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ const ModalizeBase = (
228228

229229
let toValue = 0;
230230
let toPanValue = 0;
231+
let newPosition;
231232

232233
if (dest === 'top') {
233234
toValue = 0;
@@ -251,9 +252,9 @@ const ModalizeBase = (
251252
setShowContent(true);
252253

253254
if ((alwaysOpenValue && dest !== 'top') || (snapPoint && dest === 'default')) {
254-
setModalPosition('initial');
255+
newPosition = 'initial';
255256
} else {
256-
setModalPosition('top');
257+
newPosition = 'top';
257258
}
258259

259260
Animated.parallel([
@@ -290,8 +291,10 @@ const ModalizeBase = (
290291
onOpened();
291292
}
292293

294+
setModalPosition(newPosition);
295+
293296
if (onPositionChange) {
294-
onPositionChange(modalPosition);
297+
onPositionChange(newPosition);
295298
}
296299
});
297300
};

0 commit comments

Comments
 (0)