Fix Save button unreachable behind keyboard on EditPromptPage in landscape - #100643
Fix Save button unreachable behind keyboard on EditPromptPage in landscape#100643NicolasBonet wants to merge 3 commits into
Conversation
…scape #97782 hardcoded shouldUseScrollView to false on EditPromptPage and dropped the onFocus scroll fallback, but the shrunk input already exceeds the space CollapsibleHeaderOnKeyboard reserves for it, so the disclaimer text and Save button land behind the keyboard with nothing to scroll them into view. Mirrors the working AddAgentPage pattern: scroll view is landscape-aware again and the prompt input scrolls into view on focus. Fixes #100640
|
🚧 NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
… the footer The shrink-height View has no overflow style, so a prompt longer than the reserved budget painted past its own bounds and visually overlapped the disclaimer and Save button below it instead of scrolling within its own box.
The overflow-clip attempt in the previous commit didn't address the actual gap: EditPromptPage rendered the shrink-height input and the disclaimer as bare FormProvider children, unlike AddAgentPage which groups the equivalent fields inside one flex column. Matching that structure exactly (verified working with long prompts on AddAgentPage) fixes the disclaimer rendering over the input text.
|
🚧 NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| const [agentPrompt] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_AGENT_PROMPT}${accountID}`); | ||
| const formRef = useRef<FormRef>(null); | ||
| const promptTopOffsetRef = useRef(0); | ||
| const handleInputFocus = () => scrollToMultilineInput(formRef, isInLandscapeMode, promptTopOffsetRef.current); |
There was a problem hiding this comment.
❌ CONSISTENCY-12 (docs)
The declared function handleInputFocus is named for the event it is wired to (the input's onFocus) rather than the action it performs (scrolling the prompt input into view). Per STYLE.md, a callback's definition should be named for its behavior; the on*/handle* naming belongs on the JSX prop, not the function definition. A behavior-based name keeps the handler searchable by intent and reusable across triggers.
Rename the declaration to describe what it does, e.g.:
const scrollPromptIntoView = () => scrollToMultilineInput(formRef, isInLandscapeMode, promptTopOffsetRef.current);
// ...
<InputWrapper onFocus={scrollPromptIntoView} />Reviewed at: 0f79840 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-09-09.at.14.48.44.movScreen.Recording.2026-09-09.at.14.49.40.moviOS: HybridAppScreen.Recording.2026-09-09.at.14.51.09.movScreen.Recording.2026-09-09.at.14.57.05.movMacOS: Chrome / SafariScreen.Recording.2026-09-09.at.14.57.41.mov |
| /> | ||
| <View style={[styles.flex1, styles.flexColumn, styles.gap5]}> | ||
| <View | ||
| style={shouldShrinkPromptInput ? StyleUtils.getHeight(PROMPT_MAX_HEIGHT_ON_KEYBOARD_OPEN_LANDSCAPE_MODE) : [styles.flex1]} |
There was a problem hiding this comment.
Should be:
| style={shouldShrinkPromptInput ? StyleUtils.getHeight(PROMPT_MAX_HEIGHT_ON_KEYBOARD_OPEN_LANDSCAPE_MODE) : [styles.flex1]} | |
| style={shouldShrinkPromptInput ? StyleUtils.getHeight(PROMPT_MAX_HEIGHT_ON_KEYBOARD_OPEN_LANDSCAPE_MODE) : [isInLandscapeMode ? styles.h42 : styles.flex1]} | |
here or else it's broken with open keyboard when the prompt is longer:
Explanation of Change
#97782 replaced
EditPromptPage's landscape scroll fallback with a hardcoded-height keyboard-avoidance strategy, but only wired the new mechanism up onAddAgentPage. OnEditPromptPage:shouldUseScrollViewwas hardcoded tofalse(previously landscape-aware)scrollToMultilineInputhelper added by the same PR was never wired to this page'sonFocusCollapsibleHeaderOnKeyboardonly budgets space for the input itself, not the disclaimer text and Save button below it — the shrunk input alone already exceeds that budgetWith no
ScrollViewand no scroll-into-view on focus, the disclaimer text and Save button land behind the keyboard in landscape mode with nothing to scroll them into view (partially hidden on iOS, fully hidden on Android).This change mirrors the pattern already used and working on
AddAgentPagein the same PR:shouldUseScrollView={isInLandscapeMode}and anonFocushandler that callsscrollToMultilineInput.Fixed Issues
$ #100640
PROPOSAL:
Tests
Offline tests
Same as Tests — this screen loads from cached Onyx data and does not require a network request to reproduce or verify the fix.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
ScreenRecording_09-08-2026.19-48-11_1.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari