-
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
Fixes KeyboardAutoManagerScroll when using scrollable Editor #21932
Fixes KeyboardAutoManagerScroll when using scrollable Editor #21932
Conversation
Please note that I tried to do automation on this but:
|
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
816e2a5
to
8fa112d
Compare
I just realized this solves only part of the problem. So I'll work more on it and post back when I've finished. I also found a way to add a UI test, so I will move the test page there. |
8fa112d
to
fc617b6
Compare
@jsuarezruiz I managed to create an UI test for this: that test is now failing so don't even bother running UI tests. When @tj-devel709's PR #21807 will be merged and integrated into this PR the UI test I've just added will pass and the related issue can be closed after merging this PR. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
fc617b6
to
4f23c91
Compare
@jsuarezruiz there's another use case that needs to be handled when Can I add it and add the corresponding property mapper in order to set the I know |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@albyrock87 Thanks for the PR! Would you mind explaining to me why setting the I believe this changes the logic of the scrolling code as well as you can see in the demo I will post below: TestingEditorScroll.mov |
@tj-devel709 first let's state that this magic code to handle keyboard scrolling on all use cases is very tricky. I researched a bit more, also checking out latest code from your PR and this is what I now understand:
1st: your PR with new lines working in this specific use case + a bug 2nd: UX your PR with my changes applied on top 3rd: UX your PR (also demonstrating scrolling not working on new lines when renderable editor area goes behind the keyboard) |
This fix would be nice. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
||
[Test] | ||
[Category(UITestCategories.Entry)] | ||
public void TestEditorKeyboardScrolling () |
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.
The test is failing on iOS. Could you take a look?
Expected string length 795 but was 796. Strings differ at index 710.
at Microsoft.Maui.AppiumTests.Issues.Issue20631.TestEditorKeyboardScrolling() in /Users/builder/azdo/_work/2/s/src/Controls/tests/UITests/Tests/Issues/Issue20631.cs:line 58
Thanks for the reply! I'd be curious to know exactly what in this code change gives the wanted behavior though. You mention Also wonder if your code accounts for if the editor should/has enough space to be the view doing the scrolling? Perhaps there can be some calculations if there is enough room for the editor to scroll up and still be visible and if not, scroll the next parent, but the other option of always scrolling the top view and adding possible opt-in options later down the road sounds a little safer for now. What do you think? |
I'm gonna close this PR for now because this is not a perfect solution, neither is the one from @tj-devel709 's PR. |
Description of Change
This PR fixes weird scrolling issues caused by a bug in
KeyboardAutoManagerScroll
which is not properly taking into consideration that a text field can be scrollable.I've introduced a new page in the sample on iOS specific demos given that this is an iOS specific feature. If you think this is not good I can remove it.
If this is ok, I beg you to include this in next SR.
Before:
After:
Issues Fixed
Fixes #20631
Might fix #21297