Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup with an Entry or Pickup in it goes off screen when KB comes up #1561

Closed
imsam67 opened this issue Nov 23, 2023 · 2 comments
Closed

Popup with an Entry or Pickup in it goes off screen when KB comes up #1561

imsam67 opened this issue Nov 23, 2023 · 2 comments
Labels
area/views Issue/Discussion/PR that has to do with Views bug Something isn't working unverified

Comments

@imsam67
Copy link

imsam67 commented Nov 23, 2023

Current Behavior

If I place an Entry or Picker control in a Popup, as soon as the soft keyboard shows up, the Popup goes off screen.

This was working fine before when the app was targeting .NET 7 and the previous version of CommunityToolkit.Maui. To see what maybe causing the issue, I downgraded CommunityToolkit.Maui to 6.1.0 and the app still targeting .NET 8 and the issue persisted. I then changed the TFM to .NET 7 and the issue disappeared. So the issue seems to have someting to do with .NET 8 OR CommunityToolkit.Maui's interaction with .NET 8.

Here's what it looks like:

RPReplay_Final1700763995.mov

Expected Behavior

The Popup should just slide up as it used to.

Steps To Reproduce

  1. Create a Popup in a .NET MAUI app targeting .NET 8 and using CommunityToolkit.Maui v7
  2. Place an Entry control in it. BTW, a Picker control would produce the same issue. Looks like any control that opens up the keybaord would produce the same issue
  3. Run the app iOS device
  4. Open the Popup and tap on Entry to bring up the soft keyboard

Link to public reproduction project repository

https://github.com/iQuestLLC/test-maui

Environment

- .NET MAUI CommunityToolkit: 7.0.0
- OS: iOS 17.1.1
- .NET MAUI: .NET 8

Anything else?

Somebody on X mentioned this and it actually works nicely as a workaround:
https://x.com/LachMaksymilian/status/1727792653570384313?s=20

using Microsoft.Maui.Platform;
...
// Before we open the Popup, we "Disconnect" KeyboardAutoManagerScroll
#if IOS
            KeyboardAutoManagerScroll.Disconnect();
#endif

   var popup = new MyPopUp();
   var response = await Application.Current.MainPage.ShowPopupAsync(popup);

// Once done with the Popup, we "Connect" KeyboardAutoManagerScroll again
#if IOS
            KeyboardAutoManagerScroll.Connect();
#endif

No response

@cat0363
Copy link
Contributor

cat0363 commented Dec 21, 2023

I also verified, but it did not occur in .NET 7.
This is likely due to the new scrolling feature added in .NET 8.
dotnet/maui#16784

It seems that the only way to turn off the new scrolling feature is to call the Disconnect method of the KeyboardAutoManagerScroll class.

Below are the verification results with .NET 7.

iPhone.15.iOS.17.0.2023-12-21.13-48-11.mp4

@vhugogarcia
Copy link
Contributor

This issue has been fixed using the latest version from .NET MAUI Community Toolkit 9.0.2 and .NET MAUI 8.0.70. I'm closing this issue.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/views Issue/Discussion/PR that has to do with Views bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

3 participants