[iOS] Fix Editor control does not scroll properly on iOS when enclosed in a Border control.#24683
[iOS] Fix Editor control does not scroll properly on iOS when enclosed in a Border control.#24683Tamilarasan-Paranthaman wants to merge 6 commits intodotnet:mainfrom
Conversation
|
Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
This is blocking me to migrate to border conrol from frame. with editor inside frame it is working fine. now the frame is deprecated in .net 9 and need to migrate to border. but without this fix we cant migrate. WIll it be fixed when .net 9 released. thanks |
PureWeen
left a comment
There was a problem hiding this comment.
I ran the attached uitest without the fix and it doesn't reproduce the issue.
It looks like it has to be inside a layout in order for it to reproduce
<VerticalStackLayout>
<Border Stroke="LightGray">
<Editor HeightRequest="100"
Text="Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
" />
</Border>
</VerticalStackLayout>If I remove the VSL then it no longer cuts. Which also makes me wonder if this is the correct fix.
I worry about the EditorHandler having to inspect the parent to know if it needs a container. This fix feels a little bit like it's not resolving the core issue
|
@PureWeen, without the VerticalStackLayout, the Border will occupy the full height, and the issue only occurs when the editor's content height exceeds the content mask height. If you scroll the Editor with only 7 lines and without the VerticalStackLayout, the editor's content height will not extend beyond the content mask height. This issue typically appears after adding around 28 or 29 lines in this scenario. However, you can still reproduce the issue without the VerticalStackLayout by setting the Border's HeightRequest to 150, which will reveal the problem when scrolling vertically. I apologize for the inconvenience. I missed adding the VerticalStackLayout in my test case. Should I include the VerticalStackLayout or set the Border's HeightRequest in my test case? Which option would you recommend? |
|
It works fine in Frame if anybody desperately needs rounded corners (or if this helps towards a fix). |
|
@cagriy frame is being deprecated in .net 9. It is recommened to migrate to border since frame is deprecated and will be removed in future versions. Without this fix we cant migrate to border control. |
| { | ||
| // If we are wrapped by a BorderView, we need a container | ||
| // to handle masks and clip shapes effectively. | ||
| if (VirtualView?.Parent is IBorderView) |
There was a problem hiding this comment.
I don't feel like this is the approach we'll want to take here.
- Users report that this all works fine with the Frame control
- it doesn't feel like Editor should be reaching up to the parent here to figure out if it needs a container. This feels like it's not fixing the root of the problem.
I'm still poking a bit to see if I can figure out a better approach here.
I'm curious if there's a way to fix this inside the BorderView control vs fixing here
|
Hi! What do you think about this one #25098 |
| { | ||
| App.WaitForElement("editor"); | ||
| App.ScrollDown("editor", ScrollStrategy.Programmatically); | ||
| await Task.Delay(1000); |
There was a problem hiding this comment.
I'm not sure if this will generate the same screenshots every time 🤔
|
@Tamilarasan-Paranthaman Could you rebase to fix the conflicts? Thanks in advance. |
Root Cause:
Description of Change:
Validated the behaviour in the following platforms,
Reference
Issues Fixed
Fixes #20736
Fixes #18486
Screenshots
Screen.Recording-issue.mov
Screen.Recording.mov