@hoddy-ui/core 2.5.13 → 2.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "2.5.13",
3
+ "version": "2.5.14",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -8,6 +8,7 @@ import {
8
8
  } from "react-native";
9
9
  import { ScaledSheet } from "react-native-size-matters";
10
10
  import { FormWrapperProps } from "../types";
11
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
11
12
  export const FormWrapper: React.FC<FormWrapperProps> = ({
12
13
  children,
13
14
  behavior = Platform.OS === "ios" ? "padding" : "height",
@@ -17,6 +18,9 @@ export const FormWrapper: React.FC<FormWrapperProps> = ({
17
18
  style = {},
18
19
  onScroll,
19
20
  }) => {
21
+ const { bottom } = useSafeAreaInsets();
22
+
23
+ const defaultOffset = Platform.OS === "ios" ? -bottom : -bottom * 2;
20
24
  const styles = ScaledSheet.create({
21
25
  root: {
22
26
  width: "100%",
@@ -24,13 +28,14 @@ export const FormWrapper: React.FC<FormWrapperProps> = ({
24
28
  ...style,
25
29
  },
26
30
  });
31
+
27
32
  return mode === "static" ? (
28
33
  <TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
29
34
  <KeyboardAvoidingView
30
35
  style={styles.root}
31
36
  behavior={behavior}
32
37
  contentContainerStyle={styles.root}
33
- keyboardVerticalOffset={keyboardVerticalOffset}
38
+ keyboardVerticalOffset={keyboardVerticalOffset || defaultOffset}
34
39
  >
35
40
  {children}
36
41
  </KeyboardAvoidingView>
@@ -39,7 +44,7 @@ export const FormWrapper: React.FC<FormWrapperProps> = ({
39
44
  <KeyboardAvoidingView
40
45
  behavior={behavior}
41
46
  style={styles.root}
42
- keyboardVerticalOffset={keyboardVerticalOffset}
47
+ keyboardVerticalOffset={keyboardVerticalOffset || defaultOffset}
43
48
  >
44
49
  <ScrollView
45
50
  onScroll={onScroll}