Open izarutskaya opened 1 day ago
Triggered auto assignment to @greg-schroeder (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Submit button is missing after switching layout from mobile to web
This bug occurs because isWindowHeightReducedByKeyboard is set to true and it is preventing the button from rendering
When switching the layout from web to mobile (reducing the window height), we toggle isWindowHeightReducedByKeyboard to true
However, when switching the layout from mobile to web, we do not reset isWindowHeightReducedByKeyboard to false
We should only set isWindowHeightReducedByKeyboard to true if a keyboard is available on the device.
We should include canUseTouchScreen condition.
const canUseTouchScreen = DeviceCapabilities.canUseTouchScreen();
if (!isWindowHeightReducedByKeyboard && windowHeight < prevWindowHeight - 100 && canUseTouchScreen) {
Submit button is missing after switching layout from mobile to web
The submit button is missing because the footer content is not rendered due to a condition that causes an early return, preventing the submit button from being rendered. This happens because isWindowHeightReducedByKeyboard
returns true
.
When we open the developer tools and switch to the mobile layout, isWindowHeightReducedByKeyboard
returns true
.
After switching to the desktop layout, isWindowHeightReducedByKeyboard
still returns true
because it is unable to update. Inside toggleKeyboardOnSmallScreens
, we check shouldUseNarrowLayout
and return early. On desktop, shouldUseNarrowLayout
returns false
because it is neither a small screen and not isNarrowPaneModal
. As a result, isWindowHeightReducedByKeyboard
does not update its value and remains true
, causing the footer content to return early and the submit button to be missing.
To resolve this issue, we should reset isWindowHeightReducedByKeyboard
to false
when resizing to desktop. Something like this
to
const toggleKeyboardOnSmallScreens = useCallback(
(isKBOpen: boolean) => {
if (!shouldUseNarrowLayout) {
+ if (!isSmallScreenWidth && isWindowHeightReducedByKeyboard) {
+ setIsWindowHeightReducedByKeyboard(false);
+ }
return;
}
setIsWindowHeightReducedByKeyboard(isKBOpen);
},
[shouldUseNarrowLayout],
);
We can update the condition in the footer content to return when isWindowHeightReducedByKeyboard
is true
and the screen is small. This ensures it will not execute on desktop. Something like this:
to
- if (isReadOnly || isKeyboardShown || isWindowHeightReducedByKeyboard) {
+ if (isReadOnly || isKeyboardShown || (isSmallScreenWidth && isWindowHeightReducedByKeyboard)) {
return;
}
Job added to Upwork: https://www.upwork.com/jobs/~021859734598640577777
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External
)
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.65-1 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh0811002@applause.expensifail.com Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
Submit button will be shown.
Actual Result:
Submit button is missing on confirmation page after switching layout from mobile to web.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/d57492de-5591-479d-ac36-abd7c917bfeb
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @s77rt