From a8808b4df90583f3a9aaa8fb00fe8d5529351ce6 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 7 May 2025 13:37:18 +0300 Subject: [PATCH] only add extra padding to alt text dialog when keyboard is open --- src/view/com/composer/photos/ImageAltTextDialog.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/view/com/composer/photos/ImageAltTextDialog.tsx b/src/view/com/composer/photos/ImageAltTextDialog.tsx index 1315eab8c0..1e0b8fa364 100644 --- a/src/view/com/composer/photos/ImageAltTextDialog.tsx +++ b/src/view/com/composer/photos/ImageAltTextDialog.tsx @@ -5,6 +5,7 @@ import {msg, Plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {MAX_ALT_TEXT} from '#/lib/constants' +import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible' import {enforceLen} from '#/lib/strings/helpers' import {type ComposerImage} from '#/state/gallery' import {AltTextCounterWrapper} from '#/view/com/composer/AltTextCounterWrapper' @@ -28,6 +29,7 @@ export const ImageAltTextDialog = ({ image, onChange, }: Props): React.ReactNode => { + const {height: minHeight} = useWindowDimensions() const [altText, setAltText] = React.useState(image.alt) return ( @@ -38,7 +40,8 @@ export const ImageAltTextDialog = ({ ...image, alt: enforceLen(altText, MAX_ALT_TEXT, true), }) - }}> + }} + nativeOptions={{minHeight}}> (() => { const maxWidth = IS_WEB ? 450 : windim.width const source = image.transformed ?? image.source @@ -165,7 +170,7 @@ const ImageAltTextInner = ({ {/* Maybe fix this later -h */} - {IS_ANDROID ? : null} + {IS_ANDROID && isKeyboardVisible ? : null} ) }