Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): iOS Environments trash confirms and removes persisted env #12730

Closedmacodev00(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/12730/headopened View on GitHub

Showing 6 changed files with 81 additions and 61 deletions (loading 5).

x
0 of 6 viewed, 6 left
81 additions and 61 deletionsapps/mobile/src/components/ConfirmDialogHost.tsxModified
View file
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useState } from "react";
import { Platform, Modal, Pressable, TextInput, View } from "react-native";
+import { FullWindowOverlay } from "react-native-screens";
​
import { cn } from "../lib/cn";
import { AppText } from "./AppText";
@@ -15,15 +16,17 @@
let presentRequest: ((request: DialogRequest) => void) | null = null;
​
/**
- * Imperative confirm dialog, Alert.alert-shaped. Native iOS alerts already
- * match the app (and support per-button destructive red), so this is for
- * Android, where the native dialog can only theme all confirm buttons at
- * once. Requires ConfirmDialogHost to be mounted at the app root.
+ * Imperative confirm dialog, Alert.alert-shaped. Android uses a themed
+ * in-tree dialog because the native one cannot color a single destructive
+ * button. iOS uses a FullWindowOverlay so the confirm stays visible above
+ * nested form sheets — UIAlertController from the key window does not.
+ * Requires ConfirmDialogHost to be mounted at the app root.
*/
export function showConfirmDialog(request: ConfirmDialogRequest): void {
presentRequest?.({ kind: "confirm", request });
​
+/** Imperative text-input dialog, Alert.prompt-shaped. Requires ConfirmDialogHost. */
export function showTextInputDialog(request: TextInputDialogRequest): void {
presentRequest?.({ kind: "text-input", request });