-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixed the CollectionView scroll the content inside Editor when tapping to get focus on it #27851
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
What happens if I wrap the Editor on a Grid layout? I think it will fail to find SuperView as a CollectionView |
Hi @rmarinho
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think needs a small change
movedInsets.Bottom = bottomInset; | ||
// When the superview is a MauiCollectionView and the scrollView is a MauiTextView, we do not want to change the bottom inset. | ||
bool shouldAdjustBottom = !(scrolledView is UITextView && LastScrollView is UICollectionView); | ||
if (shouldAdjustBottom) | ||
{ | ||
movedInsets.Bottom = bottomInset; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pretty close and essentially is saying to ignore the MauiTextView's bottom inset when we are inside the CollectionView. However, we do still want the MauiTextView to be able to change the movedInsets.Bottom so that we can reach the bottom of the editor when the keyboard is up.
With the following code in the MainPage.xaml.cs, you can see the following:
NotScrollingToBottom.mov
I think the below change may be better back on line 808:
// When the superview is a MauiCollectionView and the scrollView is a MauiTextView, we do not want to consider the Bottom Inset
// reserved for the Footer.
bool isMauiTextViewInCV = scrolledView is UITextView && LastScrollView is UICollectionView;
bottomInset = isMauiTextViewInCV ? bottomInset : nfloat.Max(StartingContentInsets.Bottom, bottomInset);
Then we'll get the behavior below:
ScrollingToBottom.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pretty close and essentially is saying to ignore the MauiTextView's bottom inset when we are inside the CollectionView. However, we do still want the MauiTextView to be able to change the movedInsets.Bottom so that we can reach the bottom of the editor when the keyboard is up.
Hi @tj-devel709
- I've refined the fix based on your suggestion, and now the editor can scroll to the bottom when the keyboard is up.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
84ce265
to
4be2d45
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
4be2d45
to
a2575e5
Compare
Rebased to include the fixes in flaky UITests from #28125 |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
…g to get focus on it (dotnet#27851) * Fixed the editor scroll position updated when we tap on the editor inside the collection view * Added the test case and updated the fix * Added the output images for iOS and android platform * Updated the fix and added the output images * Updated the test case * Changed the output images for iOS and android for without cursor * Removed unwanted namespace * Modified the fix for editor scrolling to bottom with softkeyboard * Updated the iOS output image.
…g to get focus on it (#27851) * Fixed the editor scroll position updated when we tap on the editor inside the collection view * Added the test case and updated the fix * Added the output images for iOS and android platform * Updated the fix and added the output images * Updated the test case * Changed the output images for iOS and android for without cursor * Removed unwanted namespace * Modified the fix for editor scrolling to bottom with softkeyboard * Updated the iOS output image.
Issue Detail
Root Cause
Description of Change
Issues Fixed
Fixes #27766
Validated the behaviour in the following platforms
Output
27766_Before.mov
27766_After.mov