-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Window currently doesn't apply AdjustPan so the view doesn't pan up (scroll) when the keyboard opens #11274
Copy link
Copy link
Closed
Labels
area-keyboardKeyboard, soft keyboardKeyboard, soft keyboardfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.52Look for this fix in 7.0.52 SR1.1!Look for this fix in 7.0.52 SR1.1!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/android
Milestone
Description
Description
Original issue here
In XF Window.SetSoftInputMode(Android.Views.SoftInput.AdjustPan); would get called after the OnCreate call whereas in MAUI it's called before OnCreate. It seems like this causes the property to have no effect
If you call this method after OnCreate than everything starts to work like XF.
Reproduction
If you take the XAML below and test a few different permutations, you'll notice that the behavior isn't currently consistent when you open a keyboard
- Shell: Nothing happens
- Shell/ScrollView: entry scrolls into view but ScrollView doesn't reset
- NavigationPage/ScrollView: entry scrolls into view but ScrollView doesn't reset
If you test this scenario on XF all permutations work the same
- the window pans up (scrolls up) when you open the keyboard
- you close the keyboard and it pans back down
<StackLayout Padding="10">
<Entry Text="Top"></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry Text="Middle"></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry></Entry>
<Entry Text="Bottom"></Entry>
</StackLayout>Workaround
Install the nuget here
or
Copy the handler and associated code from here into your code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-keyboardKeyboard, soft keyboardKeyboard, soft keyboardfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.52Look for this fix in 7.0.52 SR1.1!Look for this fix in 7.0.52 SR1.1!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/android