@jobber/components-native 0.95.1 → 0.95.2-JOB-141866-cab4e3f.3

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": "@jobber/components-native",
3
- "version": "0.95.1",
3
+ "version": "0.95.2-JOB-141866-cab4e3f.3+cab4e3feb",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -96,5 +96,5 @@
96
96
  "react-native-safe-area-context": "^5.4.0",
97
97
  "react-native-svg": ">=12.0.0"
98
98
  },
99
- "gitHead": "e51bd48b5eaa0e15ffb13f3c7745527c40997454"
99
+ "gitHead": "cab4e3febe1c59269f69b54e3b442122ac0a3cde"
100
100
  }
package/src/Form/Form.tsx CHANGED
@@ -122,8 +122,9 @@ function InternalForm<T extends FieldValues, S>({
122
122
 
123
123
  const keyboardProps = Platform.select({
124
124
  ios: {
125
- onKeyboardWillHide: handleKeyboardHide,
126
- onKeyboardWillShow: handleKeyboardShow,
125
+ onKeyboardDidHide: handleKeyboardHide,
126
+ onKeyboardDidShow: handleKeyboardShow,
127
+ onKeyboardDidChangeFrame: handleKeyboardDidChangeFrame,
127
128
  },
128
129
  android: {
129
130
  onKeyboardDidHide: handleKeyboardHide,
@@ -229,6 +230,21 @@ function InternalForm<T extends FieldValues, S>({
229
230
  </FormProvider>
230
231
  );
231
232
 
233
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
234
+ function handleKeyboardDidChangeFrame(frames: Record<string, any>) {
235
+ if (
236
+ frames &&
237
+ "endCoordinates" in frames &&
238
+ "height" in frames.endCoordinates &&
239
+ typeof frames.endCoordinates.height === "number" &&
240
+ frames.endCoordinates.height > keyboardHeight
241
+ ) {
242
+ handleKeyboardShow(frames);
243
+ } else {
244
+ handleKeyboardHide();
245
+ }
246
+ }
247
+
232
248
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
233
249
  function handleKeyboardShow(frames: Record<string, any>) {
234
250
  setKeyboardScreenY(frames.endCoordinates.screenY);