Fix View updates on Android: bundled notes, portal stack, tap handling.
Trigger cinny-mobile / dispatch (push) Successful in 2s

Bundle update markdown at build time for Capacitor, portal into
portalContainer above Settings, defer open to avoid FocusTrap closing
on the same tap, and disable click-outside dismiss.
This commit is contained in:
2026-08-23 08:38:23 +10:00
parent b6f3f5c0aa
commit c264de53b5
4 changed files with 56 additions and 19 deletions
@@ -7,6 +7,7 @@ export const PortalLayer = style({
position: 'fixed',
inset: 0,
zIndex: config.zIndex.Max,
pointerEvents: 'auto',
});
/** Dialog + overlay padding must never exceed the viewport height. */
@@ -4,7 +4,6 @@ import FocusTrap from 'focus-trap-react';
import {
Box,
Button,
config,
Dialog,
IconButton,
Overlay,
@@ -48,6 +47,9 @@ export function UpdatesDialog({
setShowOlderList(false);
};
const portalTarget =
document.getElementById('portalContainer') ?? document.body;
return createPortal(
<div className={css.PortalLayer}>
<Overlay open backdrop={<OverlayBackdrop />}>
@@ -55,8 +57,7 @@ export function UpdatesDialog({
<FocusTrap
focusTrapOptions={{
initialFocus: false,
onDeactivate: onClose,
clickOutsideDeactivates: true,
clickOutsideDeactivates: false,
escapeDeactivates: stopPropagation,
}}
>
@@ -181,6 +182,6 @@ export function UpdatesDialog({
</OverlayCenter>
</Overlay>
</div>,
document.body
portalTarget
);
}
@@ -26,7 +26,10 @@ type UpdaterInfo = {
export function useOpenReleaseNotesDialog(): () => void {
const setDialogState = useSetAtom(releaseNotesDialogAtom);
return useCallback(() => {
setDialogState({ open: true, manual: true });
// Defer so the opening tap does not trip FocusTrap click-outside on Android.
window.requestAnimationFrame(() => {
setDialogState({ open: true, manual: true });
});
}, [setDialogState]);
}