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

[regression/8.0.0] Entry pushed under keyboard and off the page iOS #16784

Closed
SamuelJames101 opened this issue Aug 16, 2023 · 22 comments
Closed
Assignees
Labels
area-controls-editor Editor area-keyboard Keyboard, soft keyboard platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@SamuelJames101
Copy link

SamuelJames101 commented Aug 16, 2023

Description

Editor / Entry should be attached to keyboard when opened and not get pushed under it, or pushed off the page. (Works on Android, Not tested WinUI and Mac).

Steps to Reproduce

  1. Create a Grid set RowDefinitions to (*,Auto)

  2. Create a CollectionView at the top of the page (grid:0).

  3. Create an editor at the bottom of the page (grid:1).

  4. Using the repo add an item to the CollectionView. (Type into the box and hit enter)

  5. Repeat step 3

Expected Result:
The Editor remains at the top of the keyboard.

Actual Result:
The Editor is pushed under the keyboard.

  1. If you continue to add items or use the fill option in the repo.
  2. Close keyboard.

Expected Result:
The Editor is back at the bottom of the screen and the collectionView takes up its given space.

Actual Result:
The Editor is pushed off the screen with the CollectionView taking up full height

Link to public reproduction project repository

https://github.com/SamuelJames101/KeyboardCollectionViewIssues

Version with bug

8.0.0-preview.7.8842

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.49

Affected platforms

iOS (13.1.1, iPhone 11 Pro), I was not able test on other platforms, os versions or devices

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

RPReplay_Final1692865580.mp4

I can also push it off the page by simply clicking the 'Fill Collection' button

@SamuelJames101 SamuelJames101 added the t/bug Something isn't working label Aug 16, 2023
@PureWeen PureWeen added the i/regression This issue described a confirmed regression on a currently supported version label Aug 16, 2023
@Eilon Eilon added area-controls-editor Editor legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels Aug 16, 2023
@tj-devel709
Copy link
Member

@SamuelJames101 thank you for the feedback. I am trying to reproduce your issue, but I am having a little trouble following along with the steps. I see that you included a repo, but I do not see the code to produce your issue. Would you be able to push your code to that repo? It may also help us validate with some images or video of the behavior you are seeing.

@SamuelJames101
Copy link
Author

@tj-devel709 Sorry, I have updated that now

@mattleibow mattleibow added this to the Backlog milestone Aug 16, 2023
@ghost
Copy link

ghost commented Aug 16, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@mattleibow mattleibow added the area-keyboard Keyboard, soft keyboard label Aug 16, 2023
@mattleibow mattleibow modified the milestones: Backlog, .NET 8 GA Aug 16, 2023
@UkeHa
Copy link

UkeHa commented Aug 21, 2023

@SamuelJames101 were you able to get this working in 7.0.49? For us the Keyboard usage in Scrollviews is also buggy in iOS in that version.

@SamuelJames101
Copy link
Author

@SamuelJames101 were you able to get this working in 7.0.49? For us the Keyboard usage in Scrollviews is also buggy in iOS in that version.

Can't comment on ScrollViews but this exact issue wasn't happening in net 7 as I was handling the entry being covered by the keyboard on iOS myself. Although there were plenty of other buggy behaviours around ScrollViews, ListViews and CollectionViews

@AnnYang01
Copy link

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0 using below Project (.NET 8.0) in iOS 16.4.
GridContainerIssueWithCollectionView.zip
The Editor is pushed under the keyboard.(repro)
image
but the Editor is not pushed off the screen with the CollectionView taking up full height.(Not repro)
KeybordPushOff

@AnnYang01 AnnYang01 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Aug 24, 2023
@SamuelJames101
Copy link
Author

@AnnYang01 I will produce a video showing it getting pushed off the screen

@SamuelJames101
Copy link
Author

@AnnYang01 I have now edited the bug item and attached a video for iOS

@AnnYang01
Copy link

@SamuelJames101 thank you for your update, we verified this issue in an iOS simulator and it did not repro, from your video, it can repro in a device.

@PureWeen
Copy link
Member

PureWeen commented Sep 2, 2023

@SamuelJames101 I'm testing this on net7 and I'm not seeing the editor staying on top of the keyboard. We didn't have any code in net7 that tried to auto scroll when the keyboard opened. We just added this in net8. It looks like we need to adjust the scroll a little but I don't see this working in net7. Everything just stays in place

image

@SamuelJames101
Copy link
Author

SamuelJames101 commented Sep 3, 2023

@PureWeen Sorry, yeah you’re correct. It was working in the sense that I handled the keyboard being overlapped myself. That no longer works however with these new changes in .net8

@PureWeen
Copy link
Member

PureWeen commented Sep 3, 2023

@SamuelJames101 if you turn off the new scroll features in net8 does that fix?

public static void Disconnect()

@PureWeen PureWeen removed the i/regression This issue described a confirmed regression on a currently supported version label Sep 3, 2023
@PureWeen PureWeen changed the title [regression/8.0.0-preview.7.8842] Entry pushed under keyboard and off the page iOS Entry pushed under keyboard and off the page iOS Sep 3, 2023
@PureWeen PureWeen modified the milestones: .NET 8 GA, Backlog Sep 3, 2023
@ghost
Copy link

ghost commented Sep 3, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@samhouts samhouts added potential-regression This issue described a possible regression on a currently supported version., verification pending and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Sep 5, 2023
@samhouts samhouts changed the title Entry pushed under keyboard and off the page iOS [regression/8.0.0] Entry pushed under keyboard and off the page iOS Sep 19, 2023
@samhouts samhouts added the s/needs-info Issue needs more info from the author label Sep 25, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 GA Sep 25, 2023
@ghost
Copy link

ghost commented Sep 25, 2023

Hi @SamuelJames101. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@developer9969
Copy link

@SamuelJames101 hi we have the overlap issue in net 7 are you willing to share your experience we solution to the issue? Many thanks

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 27, 2023
@SamuelJames101
Copy link
Author

@PureWeen What am I targeting to use that disconnect feature?

@SamuelJames101
Copy link
Author

@developer9969 Hello, You can create a custom handler for a custom contentView. Using that new custom content view on the pages in which you don't want the keyboard overlap. For iOS you can then hook into the "UIKeyboard.Notifications.ObserveWillShow(OnKeyboardShow)" events on the handler. When the "OnKeyboardShow" method is ran you can then set the pages bottom padding to the height of the keyboard. I used " NSValue result = (NSValue)e.Notification.UserInfo.ObjectForKey(new NSString(UIKeyboard.FrameEndUserInfoKey));
CGSize keyboardSize = result.RectangleFValue.Size; " you may need to play around with the size slightly to account for any keyboard margins. Listen to the keyboard "ObserveWillHide" and once its hit just set the padding back to zero or what it was before the new padding.

@PureWeen PureWeen modified the milestones: .NET 8 GA, .NET 8 SR1 Sep 27, 2023
@tj-devel709
Copy link
Member

tj-devel709 commented Sep 28, 2023

Hi, @SamuelJames101. You can try calling something like this:

using Microsoft.Maui.Platform;
...

#if IOS
			KeyboardAutoManagerScroll.Disconnect();
#endif

It is currently hard to find a place to call this (in lifecycle events) since it looks like a lot of the lifecycle events are called prior to the Connect counterpart being called. I have a fix I'm working on now for this. Sorry for the inconvenience!

@tj-devel709
Copy link
Member

@AnnYang01, I am also seeing the editor not coming up high enough. There seems to be a corner case with some layouts that have a grid as the top level in the keyboard scrolling logic and I am looking at that now.

@tj-devel709
Copy link
Member

tj-devel709 commented Oct 25, 2023

Hi, @SamuelJames101. You can try calling something like this:

using Microsoft.Maui.Platform;
...

#if IOS
			KeyboardAutoManagerScroll.Disconnect();
#endif

It is currently hard to find a place to call this (in lifecycle events) since it looks like a lot of the lifecycle events are called prior to the Connect counterpart being called. I have a fix I'm working on now for this. Sorry for the inconvenience!

This PR landed for GA and will make it easier to call the KeyboardAutoManagerScroll.Disconnect() method inside the lifecycle events!

@tj-devel709
Copy link
Member

@AnnYang01, I am also seeing the editor not coming up high enough. There seems to be a corner case with some layouts that have a grid as the top level in the keyboard scrolling logic and I am looking at that now.

Here is the issue for this here: #18354

@tj-devel709
Copy link
Member

I'm going to close the issue here for now @SamuelJames101. If calling the Disconnect method and keeping your original custom code does not work, please feel free to reopen this issue.

This issue sort of split into two different issues - @AnnYang01 please follow the progress and add any other comments for the grid issue here: #18354

@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Oct 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 24, 2023
@samhouts samhouts added platform/iOS 🍎 and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-editor Editor area-keyboard Keyboard, soft keyboard platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

9 participants