Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Version used: Android 11.0
Devices/Android versions reproduced on: Pixel 5/Android 11.0
Hello,
I am reaching out about a bug occurring when using the UI component ViewPager2. When using ViewPager2 to page between fragments, the initial fragment shown first does not get focus nor is the soft keyboard shown even though there is an explicit call to requestFocus() for the fragment/it's view. It is not until swiping to the next fragment, that the focus is set, and the soft keyboard comes up. This bug is preventing us from using this component in a new feature.
I have attached a sample project to recreate the bug.
Test Steps
1. Boot sample app
2. Observe the EditText is not focused, even though the fragment has called view.requestFocus() on it
3. Swipe to next second fragment
4. Observe the EditText receives focus
5. Uncomment handler()
6. Re-run app
7. Observe the EditText of first fragment receives focus