@supportworks/multi-imagepicker 8.3.8 → 8.4.0

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/changes.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ # v8.4.0 2026-07-15
3
+ * DEV-9653: Fixed iOS camera modal handoff so captured photos are processed only after the native modal has fully dismissed. This prevents the Add Images editor from opening behind an invisible modal layer that can swallow touches and make the app appear frozen.
4
+
5
+ # v8.3.9 2026-06-03
6
+ * removed deprecated absoluteFillObject
7
+
2
8
  # v8.3.3 2026-04-28
3
9
  * orientation on modal
4
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supportworks/multi-imagepicker",
3
- "version": "8.3.8",
3
+ "version": "8.4.0",
4
4
  "description": "Android and iOS customized multiple image picker. For react-native >= 0.60.",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -208,13 +208,21 @@ const styles = StyleSheet.create({
208
208
  flex: 1
209
209
  },
210
210
  Overlay: {
211
- ...StyleSheet.absoluteFillObject,
211
+ position: 'absolute',
212
+ top: 0,
213
+ left: 0,
214
+ right: 0,
215
+ bottom: 0,
212
216
  justifyContent: 'flex-end',
213
217
  zIndex: 1000,
214
218
  elevation: 1000
215
219
  },
216
220
  Backdrop: {
217
- ...StyleSheet.absoluteFillObject,
221
+ position: 'absolute',
222
+ top: 0,
223
+ left: 0,
224
+ right: 0,
225
+ bottom: 0,
218
226
  backgroundColor: 'rgba(0,0,0,0.45)'
219
227
  },
220
228
  Sheet: {
@@ -241,11 +241,6 @@ const CameraModal: React.FC<CameraTestModalProps> = ({ onDone, onCancel, cameraR
241
241
  const showCameraSwitchControl = !isTightLayout
242
242
  const showSecondaryControls = showFlashControl || showCameraSwitchControl
243
243
 
244
- // Debug logging
245
- React.useEffect(() => {
246
- console.log('CameraModal: cameraRef is', externalCameraRef ? 'external' : 'internal')
247
- console.log('CameraModal: cameraRef.current is', cameraRef.current ? 'not null' : 'null')
248
- }, [externalCameraRef, cameraRef])
249
244
  const swipeModalRef = useRef<any>(null)
250
245
  const shutterFlashAnim = useRef(new Animated.Value(0)).current
251
246
  const [currentZoom, setCurrentZoom] = useState<number>(DEFAULT_ZOOM)
@@ -1131,7 +1126,11 @@ const styles = StyleSheet.create({
1131
1126
  zIndex: 12
1132
1127
  },
1133
1128
  captureLimitBannerOverlay: {
1134
- ...StyleSheet.absoluteFillObject,
1129
+ position: 'absolute',
1130
+ top: 0,
1131
+ left: 0,
1132
+ right: 0,
1133
+ bottom: 0,
1135
1134
  alignItems: 'center',
1136
1135
  justifyContent: 'center',
1137
1136
  paddingHorizontal: 24,
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useMemo, useRef, forwardRef, useImperativeHandle, useState } from 'react'
1
+ import React, { useCallback, useMemo, useRef, forwardRef, useImperativeHandle, useState } from 'react'
2
2
  import {
3
3
  AppState,
4
4
  View,
@@ -48,6 +48,7 @@ const MultiImagePicker = forwardRef((props, ref) => {
48
48
  } = props
49
49
 
50
50
  const [showCameraModal, setShowCameraModal] = useState(false)
51
+ const [isCameraModalMounted, setIsCameraModalMounted] = useState(false)
51
52
  const [pendingPickerIndex, setPendingPickerIndex] = useState(null)
52
53
  const [pendingCancelIndex, setPendingCancelIndex] = useState(null)
53
54
  const [actionSheetInstanceKey, setActionSheetInstanceKey] = useState(0)
@@ -56,7 +57,7 @@ const MultiImagePicker = forwardRef((props, ref) => {
56
57
  const imgDescArrRef = useRef([]) // temp array for holding descriptions of selected images, before saved to project
57
58
  const imgValidArrRef = useRef([]) // temp array for holding boolean value specifying whether each image title is valid or not
58
59
  const actionSheetRef = useRef(null)
59
- const pendingCameraProcessTimeoutRef = useRef(null)
60
+ const pendingCameraResultRef = useRef(null)
60
61
 
61
62
  const resolvedMaxCount = useMemo(() => {
62
63
  const parsedMaxCount = Number(maxCount)
@@ -84,13 +85,6 @@ const MultiImagePicker = forwardRef((props, ref) => {
84
85
  setActionSheetInstanceKey((prevKey) => prevKey + 1)
85
86
  }, [])
86
87
 
87
- const clearPendingCameraProcessTimeout = useCallback(() => {
88
- if (pendingCameraProcessTimeoutRef.current) {
89
- clearTimeout(pendingCameraProcessTimeoutRef.current)
90
- pendingCameraProcessTimeoutRef.current = null
91
- }
92
- }, [])
93
-
94
88
  const showSelectionLimitAlert = useCallback(() => {
95
89
  const message = remainingCount <= 0
96
90
  ? `You already have the maximum of ${resolvedMaxCount} photo(s)`
@@ -279,31 +273,39 @@ const MultiImagePicker = forwardRef((props, ref) => {
279
273
  const pickerIndex = pendingPickerIndex
280
274
  const cancelIndex = pendingCancelIndex
281
275
 
282
- clearPendingCameraProcessTimeout()
276
+ pendingCameraResultRef.current = {
277
+ images,
278
+ pickerIndex,
279
+ cancelIndex
280
+ }
281
+
283
282
  setShowCameraModal(false)
284
283
  resetActionSheet()
285
-
286
- if (images && images.length > 0) {
287
- if (pickerIndex !== null && cancelIndex !== null) {
288
- pendingCameraProcessTimeoutRef.current = setTimeout(() => {
289
- pendingCameraProcessTimeoutRef.current = null
290
- processCameraModalImages(images, pickerIndex, cancelIndex)
291
- }, 350)
284
+ }, [pendingCancelIndex, pendingPickerIndex, resetActionSheet])
285
+
286
+ const handleCameraModalDismiss = useCallback(() => {
287
+ const pendingResult = pendingCameraResultRef.current
288
+ pendingCameraResultRef.current = null
289
+
290
+ setIsCameraModalMounted(false)
291
+
292
+ // Wait for native Modal dismissal before opening the image editor; otherwise
293
+ // iOS can leave an invisible modal layer above the editor and swallow touches.
294
+ if (pendingResult?.images?.length > 0) {
295
+ if (pendingResult.pickerIndex !== null && pendingResult.cancelIndex !== null) {
296
+ processCameraModalImages(
297
+ pendingResult.images,
298
+ pendingResult.pickerIndex,
299
+ pendingResult.cancelIndex
300
+ )
292
301
  } else {
293
302
  console.log('SWSI Camera modal missing picker indices; skipping captured image handoff')
294
303
  }
295
304
  }
296
305
 
297
- // Reset pending indices
298
306
  setPendingPickerIndex(null)
299
307
  setPendingCancelIndex(null)
300
- }, [clearPendingCameraProcessTimeout, pendingCancelIndex, pendingPickerIndex, processCameraModalImages, resetActionSheet])
301
-
302
- useEffect(() => {
303
- return () => {
304
- clearPendingCameraProcessTimeout()
305
- }
306
- }, [clearPendingCameraProcessTimeout])
308
+ }, [processCameraModalImages])
307
309
 
308
310
  const takeOnePicture = useCallback(async (
309
311
  index,
@@ -378,6 +380,7 @@ const MultiImagePicker = forwardRef((props, ref) => {
378
380
  setPendingPickerIndex(index)
379
381
  setPendingCancelIndex(cancelIndex)
380
382
  resetActionSheet()
383
+ setIsCameraModalMounted(true)
381
384
  setShowCameraModal(true)
382
385
  } else {
383
386
  // Fall back to native camera (Android)
@@ -465,12 +468,13 @@ const MultiImagePicker = forwardRef((props, ref) => {
465
468
  <TouchableOpacity {...touchableProps} onPress={showActionSheet}>
466
469
  {children}
467
470
  </TouchableOpacity>
468
- {Platform.OS === 'ios' && showCameraModal && (
471
+ {Platform.OS === 'ios' && isCameraModalMounted && (
469
472
  <Modal
470
473
  visible={showCameraModal}
471
474
  animationType='slide'
472
475
  presentationStyle='fullScreen'
473
476
  supportedOrientations={['portrait', 'portrait-upside-down', 'landscape-left', 'landscape-right']}
477
+ onDismiss={handleCameraModalDismiss}
474
478
  onRequestClose={() => handleCameraModalDone([])}
475
479
  >
476
480
  <CameraModal
@@ -57,13 +57,21 @@ const UploadWarningModal = (
57
57
 
58
58
  const styles = StyleSheet.create({
59
59
  ModalView: {
60
- ...StyleSheet.absoluteFillObject,
60
+ position: 'absolute',
61
+ top: 0,
62
+ left: 0,
63
+ right: 0,
64
+ bottom: 0,
61
65
  justifyContent: 'center',
62
66
  alignItems: 'center',
63
67
  zIndex: 10
64
68
  },
65
69
  Backdrop: {
66
- ...StyleSheet.absoluteFillObject,
70
+ position: 'absolute',
71
+ top: 0,
72
+ left: 0,
73
+ right: 0,
74
+ bottom: 0,
67
75
  backgroundColor: colors.black36
68
76
  },
69
77
  InfoDialogContent: {