-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Adding ContentInsets to iOS Keyboard Scrolling #14371
Conversation
Please note, when we click an entry or editor that does not require the screen to scroll (the last part of the demo in the description), there is no ContentInset added to the scrollview and we cannot reach the bottom of the scrollview. It is most likely possible to still add this ContentInset to every Entry and Editor inside a scrollview, however, this PR reflects how Android handles this situation as shown in this video below. Let me know if there are concerns or opinions on which way is best to handle this. AndroidScrollingInsets.mov |
Did you tested with a CollectionView with entries ? |
@ruiminhu I have not, but I'll give it a shot today! |
Did run into some issues with collectionview and spending more time investigating them! |
@ruiminhu there were some changes needed from IQKeyboard since I changed some of the scrolling behavior to fit MAUI's controllers better. Looks good to me now with Collectionview! (android for comparison) iOSCollectionViewInset.movAndroidCollectionViewInsets.mov |
Why do the scrolls have a large padding (inset) in the beginning on your videos? What's the sample code for that example? |
Hey @ruiminhu, yeah I just had an empty boxview to test having the items towards the bottom of the screen. Here is the sample code: |
@tj-devel709 why we are putting CollectionView in ScrollView In you sample?. Shouldn't we could add ContentInset to Collectiontion view if entry which is opening a keyboard is inside CollectionView in case of iOS. I was able to do that previously I couldn't find the code but I was subscribing to KeyboardOpen event and checking if keyboard would overlap entry in that case I was adding appropriate ContentInset to CollectionView. My requirement was different though I was having Editor(AutoSize=true) inside CollectionView. The issue in this I was having was since Editor AutoSize was true when user writing long multiple line text, after adding few line editor would go under the keyboard after this user cannot see what he was typing. Yes user can scroll up the collection view manually with interaction but still customer was not happy with the behviour in iOS. On Android though collection view was moving up automatically on every next line if editor is about to go under keyboard. I hope you make sure of this editor expanding behaviour atleast in ScrollView(Without CollectionView). |
Description of Change
Maui iOS does not apply any ContentInsets to the appropriate scrolling view when the screen scrolls up for the keyboard. While this is not a regression from the new Keyboard Scrolling feature, IQKeyboard does handle this and will allow us to focus an entry or editor, scroll around the page (with the keyboard still up) and still be able to scroll back down and see our focused view.
IQKeyboard has logic here to update the ContentInset when we scroll for the keyboard.
This PR brings over this functionality.
iOSInsetBehavior.mov
Issues Fixed
Fixes #14043