Skip to content

[inflight/candidate] [iOS] Editor can't be scrolled after rotating simulator. - #39318

Merged
kubaflo merged 1 commit into
inflight/candidatefrom
backport/pr-39047-to-inflight/candidate
Oct 12, 2026
Merged

kubaflo merged 1 commit into
inflight/candidatefrom
backport/pr-39047-to-inflight/candidate

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Backport of #39047 to inflight/candidate for SR12 Apple compatibility. This intentionally targets Candidate rather than main.

Preserves Editor scrolling after device rotation by using the remeasured native sizeThatFits.Height when deciding whether to cap the Editor height. Includes the original Issue38802 reproduction page and automated rotation regression test unchanged.

Source commit: 0c5ddc05a22704148d02d6468494f211a7c0230e. The complete three-file source patch is preserved; no unrelated changes are included.

Issues Fixed

Fixes #38802 (backport).

Validation

  • git diff --check origin/inflight/candidate...origin/backport/pr-39047-to-inflight/candidate — passed.
  • Source and backport diffs, including all tests, have the same git patch-id --stable: 636f90901cbd9aca608a2305086a28a4f7a2eb59.
  • Candidate baseline: 29eb037ad1cac21acdc052bc7a1211a8bb37d3c9; backport head: 6f961236f3df824d8e8f41c8bcbd410752f53070.
  • maui-pr build 1631863 is running for this exact PR head; its result is not yet available.
  • Device/UI runtime tests were not rerun locally. No simulator, Appium, or XCTest was launched.

/cc @kubaflo @SubhikshaSf4851

<!-- Please keep the note below for people who find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment whether this change resolves your
issue. Thank you!


### Root cause:

- During rotation, the `Editor` is remeasured with an infinite height
constraint. When the native `ContentSize.Height` is equal to the
previously arranged height, the existing strict > check does not
preserve the current height.
- This allows MAUI to measure the reflowed text at its full content
height, causing the Editor to expand and lose scrolling.
### Changes made: 
- Fixed the logic in `EditorHandler.iOS.cs` to use `sizeThatFits.Height`
instead of `PlatformView.ContentSize.Height` when determining if the
`Editor` should cap its height, preventing the `Editor` from growing
unexpectedly after device rotation.
- Prevents the Editor from expanding to its full reflowed content height
and preserves vertical scrolling after rotation.

**Test coverage improvements:**

* Added a new test page `Issue38802` in `TestCases.HostApp` that binds
an `Editor`'s `CharacterSpacing` to a `Slider` and describes manual
steps to reproduce and verify the issue.
* Added an automated UI test for `Issue38802` in
`TestCases.Shared.Tests` which programmatically rotates the device and
asserts that the Editor's height remains unchanged after rotation.
<!-- Enter description of the fix in this section -->

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38802 
### Tested the behavior in the following platforms

- [ ] Windows
- [ ] Android
- [x] iOS
- [ ] Mac

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/68841ca7-ec01-4d5f-a635-a21c18f8aa38">
| <video
src="https://github.com/user-attachments/assets/3619dcdb-d406-4fa0-bbf4-48c16e94a213">
|
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@kubaflo
kubaflo merged commit 018d15f into inflight/candidate Oct 12, 2026
4 of 35 checks passed
@kubaflo
kubaflo deleted the backport/pr-39047-to-inflight/candidate branch October 12, 2026 10:48
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Oct 12, 2026
kubaflo added a commit that referenced this pull request Oct 13, 2026
…mulator. (#39318)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Backport of #39047 to `inflight/candidate` for SR12 Apple compatibility.
This intentionally targets Candidate rather than `main`.

Preserves Editor scrolling after device rotation by using the remeasured
native `sizeThatFits.Height` when deciding whether to cap the Editor
height. Includes the original Issue38802 reproduction page and automated
rotation regression test unchanged.

Source commit: `0c5ddc05a22704148d02d6468494f211a7c0230e`. The complete
three-file source patch is preserved; no unrelated changes are included.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38802 (backport).

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

### Validation

- `git diff --check
origin/inflight/candidate...origin/backport/pr-39047-to-inflight/candidate`
— passed.
- Source and backport diffs, including all tests, have the same `git
patch-id --stable`: `636f90901cbd9aca608a2305086a28a4f7a2eb59`.
- Candidate baseline: `29eb037ad1cac21acdc052bc7a1211a8bb37d3c9`;
backport head: `6f961236f3df824d8e8f41c8bcbd410752f53070`.
- `maui-pr` [build
1631863](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1631863)
is running for this exact PR head; its result is not yet available.
- Device/UI runtime tests were not rerun locally. No simulator, Appium,
or XCTest was launched.

/cc @kubaflo @SubhikshaSf4851

Co-authored-by: Subhiksha Chandrasekaran <subhiksha.c@syncfusion.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Oct 14, 2026
…mulator. (#39318)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Backport of #39047 to `inflight/candidate` for SR12 Apple compatibility.
This intentionally targets Candidate rather than `main`.

Preserves Editor scrolling after device rotation by using the remeasured
native `sizeThatFits.Height` when deciding whether to cap the Editor
height. Includes the original Issue38802 reproduction page and automated
rotation regression test unchanged.

Source commit: `0c5ddc05a22704148d02d6468494f211a7c0230e`. The complete
three-file source patch is preserved; no unrelated changes are included.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38802 (backport).

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

### Validation

- `git diff --check
origin/inflight/candidate...origin/backport/pr-39047-to-inflight/candidate`
— passed.
- Source and backport diffs, including all tests, have the same `git
patch-id --stable`: `636f90901cbd9aca608a2305086a28a4f7a2eb59`.
- Candidate baseline: `29eb037ad1cac21acdc052bc7a1211a8bb37d3c9`;
backport head: `6f961236f3df824d8e8f41c8bcbd410752f53070`.
- `maui-pr` [build
1631863](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1631863)
is running for this exact PR head; its result is not yet available.
- Device/UI runtime tests were not rerun locally. No simulator, Appium,
or XCTest was launched.

/cc @kubaflo @SubhikshaSf4851

Co-authored-by: Subhiksha Chandrasekaran <subhiksha.c@syncfusion.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Oct 18, 2026
…mulator. (#39318)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

<!-- Enter description of the fix in this section -->

Backport of #39047 to `inflight/candidate` for SR12 Apple compatibility.
This intentionally targets Candidate rather than `main`.

Preserves Editor scrolling after device rotation by using the remeasured
native `sizeThatFits.Height` when deciding whether to cap the Editor
height. Includes the original Issue38802 reproduction page and automated
rotation regression test unchanged.

Source commit: `0c5ddc05a22704148d02d6468494f211a7c0230e`. The complete
three-file source patch is preserved; no unrelated changes are included.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #38802 (backport).

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

### Validation

- `git diff --check
origin/inflight/candidate...origin/backport/pr-39047-to-inflight/candidate`
— passed.
- Source and backport diffs, including all tests, have the same `git
patch-id --stable`: `636f90901cbd9aca608a2305086a28a4f7a2eb59`.
- Candidate baseline: `29eb037ad1cac21acdc052bc7a1211a8bb37d3c9`;
backport head: `6f961236f3df824d8e8f41c8bcbd410752f53070`.
- `maui-pr` [build
1631863](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1631863)
is running for this exact PR head; its result is not yet available.
- Device/UI runtime tests were not rerun locally. No simulator, Appium,
or XCTest was launched.

/cc @kubaflo @SubhikshaSf4851

Co-authored-by: Subhiksha Chandrasekaran <subhiksha.c@syncfusion.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants