From ec7252138c557fb569ccd87bfac2df4c22a8fe4a Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Thu, 20 Mar 2025 08:02:58 +0530 Subject: [PATCH] home: Fix compose box not visible on focus in Firefox Android. Fixes #34010 From version 132, Firefox now defaults to not resize the viewport content but only the visual viewport. While this works well in Chrome Android, it creates a buggy experience in Firefox Android where the compose box is hidden under keyboard. To fix it, we rollback to resizing content when keyboard is shown on Firefox Android. --- templates/zerver/app/index.html | 7 ++++++- zerver/views/home.py | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.html index 3f41c6e2e7..e95447e0bc 100644 --- a/templates/zerver/app/index.html +++ b/templates/zerver/app/index.html @@ -7,7 +7,12 @@ {% set PAGE_DESCRIPTION = _("Browse the publicly accessible channels in {org_name} without logging in.").format(org_name=realm_name) %} {% block meta_viewport %} - + + {% endblock %} {% block customhead %} diff --git a/zerver/views/home.py b/zerver/views/home.py index de2c72b988..b5811e47fd 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -244,6 +244,7 @@ def home_real(request: HttpRequest) -> HttpResponse: csp_nonce = secrets.token_hex(24) user_permission_info = get_user_permission_info(user_profile) + is_firefox_android = "Firefox" in client_user_agent and "Android" in client_user_agent response = render( request, @@ -254,6 +255,7 @@ def home_real(request: HttpRequest) -> HttpResponse: "csp_nonce": csp_nonce, "color_scheme": user_permission_info.color_scheme, "enable_gravatar": settings.ENABLE_GRAVATAR, + "is_firefox_android": is_firefox_android, "s3_avatar_public_url_prefix": settings.S3_AVATAR_PUBLIC_URL_PREFIX if settings.LOCAL_UPLOADS_DIR is None else "",