From 785301036b8533273a684644b8a7adca9a6098c1 Mon Sep 17 00:00:00 2001 From: Alessio Cancian Date: Wed, 1 Sep 2021 23:47:52 +0200 Subject: [PATCH] Should fix #9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The view I measured had a maxHeight, so should have never been greater than expected. For some reason, in the simulator I tested with, it was higher by some decimals so I didn’t realize that. --- lib/ActionSheetCustom.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ActionSheetCustom.js b/lib/ActionSheetCustom.js index 3632656..9563887 100644 --- a/lib/ActionSheetCustom.js +++ b/lib/ActionSheetCustom.js @@ -6,7 +6,7 @@ import BlurView from './BlurView' import { Platform } from 'react-native' const WARN_COLOR = '#FF3B30' -const MAX_HEIGHT = Dimensions.get('window').height * 0.8 +const MAX_HEIGHT = Math.round(Dimensions.get('window').height * 0.8) class ActionSheet extends React.Component { static defaultProps = { @@ -189,7 +189,7 @@ class ActionSheet extends React.Component { iosStyle ? styles.bodyIos : (darkMode ? styles.bodyDark : styles.body), { opacity: translateY ? 1 : 0, - maxHeight: MAX_HEIGHT, + maxHeight: MAX_HEIGHT + 1, transform: [{ translateY: sheetAnim.interpolate({ inputRange: [0, 1], diff --git a/package.json b/package.json index 2a20fef..ad754bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@alessiocancian/react-native-actionsheet", - "version": "3.0.3", + "version": "3.0.4", "description": "Cross platform ActionSheet. This component implements a custom ActionSheet and provides the same way to drawing it on the defferent platforms(iOS and Android). Actually, In order to keep the best effect, it still uses the ActionSheetIOS on iOS.", "main": "lib/index.js", "types": "lib/ts/index.d.ts",