enh
This commit is contained in:
parent
bac35e6562
commit
176e3eea9d
2 changed files with 37 additions and 6 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { View, Modal, ScrollView, KeyboardAvoidingView, Platform, Keyboard } from 'react-native';
|
import { View, Modal, ScrollView, KeyboardAvoidingView, Platform, Keyboard, StyleSheet, ActivityIndicator } from 'react-native';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { tw, MyText, MyTouchableOpacity , Checkbox , MyTextInput , LoadingDialog , BottomDialog , BottomDropdown } from 'common-ui';
|
import { tw, MyText, MyTouchableOpacity , Checkbox , MyTextInput , BottomDialog , BottomDropdown } from 'common-ui';
|
||||||
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
import { trpc } from '../trpc-client';
|
import { trpc } from '../trpc-client';
|
||||||
import LocationMapStep from './location/LocationMapStep';
|
import LocationMapStep from './location/LocationMapStep';
|
||||||
|
|
@ -469,10 +469,27 @@ const AddressForm: React.FC<AddressFormProps & {
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
|
||||||
<LoadingDialog
|
{/*
|
||||||
open={isSubmitting}
|
The submit loader is an in-tree overlay, NOT a LoadingDialog Modal.
|
||||||
message={isEdit ? "Updating address..." : "Adding address..."}
|
This form is itself rendered inside a Modal (cart/me sheets, the location
|
||||||
/>
|
flow). Dismissing a nested Modal and then the hosting Modal in quick
|
||||||
|
succession leaves an invisible native layer that blocks every touch on
|
||||||
|
iOS (react-native#50152). Keeping the loader inline removes the second
|
||||||
|
Modal entirely, so closing the sheet can never strand that layer.
|
||||||
|
*/}
|
||||||
|
{isSubmitting && (
|
||||||
|
<View
|
||||||
|
testID="address-submit-overlay"
|
||||||
|
style={[StyleSheet.absoluteFill, tw`bg-black bg-opacity-40 justify-center items-center`]}
|
||||||
|
>
|
||||||
|
<View style={tw`bg-white rounded-xl p-8 items-center justify-center min-w-50 min-h-37.5 shadow-lg`}>
|
||||||
|
<ActivityIndicator size="large" color="#3B82F6" style={tw`mb-4`} />
|
||||||
|
<MyText style={tw`text-base text-gray-500 text-center`}>
|
||||||
|
{isEdit ? "Updating address..." : "Adding address..."}
|
||||||
|
</MyText>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Region picker: the map opens focused on whichever region is chosen. */}
|
{/* Region picker: the map opens focused on whichever region is chosen. */}
|
||||||
<BottomDialog open={mapRegionPickerOpen} onClose={closeMapRegionPicker}>
|
<BottomDialog open={mapRegionPickerOpen} onClose={closeMapRegionPicker}>
|
||||||
|
|
|
||||||
|
|
@ -867,3 +867,17 @@ never read the new switch. WebViewWrapper was a third surface (host-gated
|
||||||
+ ROOT-34: closable store dialog renders Later and dismisses.
|
+ ROOT-34: closable store dialog renders Later and dismisses.
|
||||||
--- apps/user-ui/JEST-TEST-CASES.md
|
--- apps/user-ui/JEST-TEST-CASES.md
|
||||||
+ ROOT-33/ROOT-34 rows; ROOT-05/06 note the switch.
|
+ ROOT-33/ROOT-34 rows; ROOT-05/06 note the switch.
|
||||||
|
|
||||||
|
[2026-11-08 15:47:34 IST] cart add-address: fix the invisible touch-blocking layer after a successful save (ported from neo-region).
|
||||||
|
|
||||||
|
On iOS, a Modal dismissed while another Modal is presenting/dismissing can leave
|
||||||
|
an empty native layer that swallows every touch (react-native#50152). The cart's
|
||||||
|
add-address form is already inside RawBottomDialog/CartAddressGate's Modal, and
|
||||||
|
AddressForm rendered its submit loader as a second Modal (LoadingDialog), then
|
||||||
|
closed that loader and the host sheet in quick succession. After saving, the
|
||||||
|
cart looked frozen.
|
||||||
|
|
||||||
|
--- apps/user-ui/src/components/AddressForm.tsx
|
||||||
|
- submit <LoadingDialog> (nested Modal)
|
||||||
|
+ inline absolute-fill overlay with the same spinner + message inside the form's
|
||||||
|
KeyboardAvoidingView; no second native modal to leave behind
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue