Skip to content

Conversation

@hliana-stripe
Copy link
Contributor

Summary

On Samsung Galaxy devices (S23, S25), input fields in popovers get covered by the soft keyboard when using embedded component views (e.g., PaymentsView). This works correctly on Pixel devices and in DialogFragment-based components (e.g., AccountOnboardingController).

Suspected cause
The web layer uses a ResizeObserver on the container div to detect size changes and reposition popovers. On Pixel devices, the WebView content area resizes when the keyboard appears, triggering the ResizeObserver. On Samsung devices, we observed that the WebView content area does not resize when the keyboard appears, so the ResizeObserver never fires and the popover stays in its original position (now covered by keyboard). This seems to be a semi-common issue unique to Samsung + webviews.

Fix
Manually detect keyboard height + visibility and resize the WebView's layoutParams.height. Explicit height change forces the WebView to resize --> causes the container div to resize --> triggers ResizeObserver, which repositions popovers correctly

Motivation

Reported bug on Samsung Galaxy devices

Testing

  • Added tests
  • Modified tests
  • Manually verified

Manually verified; bc the behavior is so specific to Samsung devices and keyboard, it did not seem super unit testable

Screenshots

Before

reproBeforeSamsungFix.mov

After

AndroidFixedBug.mov

Changelog

@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │          compressed          │         uncompressed         
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │   2.2 MiB │   2.2 MiB │  0 B │   4.5 MiB │   4.5 MiB │  0 B 
     arsc │   1.1 MiB │   1.1 MiB │  0 B │   1.1 MiB │   1.1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │     8 KiB │     8 KiB │  0 B 
      res │ 303.5 KiB │ 303.5 KiB │  0 B │ 457.7 KiB │ 457.7 KiB │  0 B 
   native │   7.9 MiB │   7.9 MiB │  0 B │  19.3 MiB │  19.3 MiB │  0 B 
    asset │   6.6 KiB │   6.6 KiB │  0 B │   6.3 KiB │   6.3 KiB │  0 B 
    other │ 107.5 KiB │ 107.5 KiB │ -8 B │ 214.9 KiB │ 214.9 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │  11.5 MiB │  11.5 MiB │ -8 B │  25.5 MiB │  25.5 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 21291 │ 21291 │ 0 (+0 -0) 
   types │  6505 │  6505 │ 0 (+0 -0) 
 classes │  5216 │  5216 │ 0 (+0 -0) 
 methods │ 31840 │ 31840 │ 0 (+0 -0) 
  fields │ 18204 │ 18204 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  163 │  163 │  0   
 entries │ 3719 │ 3719 │  0
APK
   compressed    │   uncompressed   │                        
──────────┬──────┼───────────┬──────┤                        
 size     │ diff │ size      │ diff │ path                   
──────────┼──────┼───────────┼──────┼────────────────────────
 29.4 KiB │ -5 B │  65.4 KiB │  0 B │ ∆ META-INF/CERT.SF     
   26 KiB │ -2 B │  65.3 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
  1.2 KiB │ -1 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA    
──────────┼──────┼───────────┼──────┼────────────────────────
 56.6 KiB │ -8 B │ 131.9 KiB │  0 B │ (total)

@gimenete-stripe
Copy link
Contributor

This change looks good to me but I'm not an Android expert. Maybe @maragues-stripe could take a look.

maragues-stripe
maragues-stripe previously approved these changes Feb 2, 2026
Copy link

@maragues-stripe maragues-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the deep research!

Comment on lines +165 to +167
// Set up keyboard detection to resize the webview according to keyboard heights
// This fixes input fields being covered by keyboard on Samsung devices.
setupKeyboardHandling(activity)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we only add this custom behavior on samsung devices?

I've found this bug report, triaged but untouched since 2023. https://issuetracker.google.com/issues/311256305. Do you think this is the source of the issue? If it is, let's add a comment to keep an eye on it.

It's not specific to Samsung, so perhaps it's wiser to add the fix to all devices 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix will apply to all devices! But I don't think setDecorFitsSystemWindows issue relates to this bug as we don't use setDecorFitsSystemWindows in these views. We do, however, use setDecorFitsSystemWindows in the Onboarding component which is a full screen dialog component - which makes this a non-issue for that component. IIUC we can't convert the Payments & Payout components into a dialog type of component since it is meant to be inline with other UI from the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants