Skip to content
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

Editor Scaling creating new lines on older iOS versions #25581

Open
tj-devel709 opened this issue Oct 29, 2024 · 3 comments · May be fixed by #25691
Open

Editor Scaling creating new lines on older iOS versions #25581

tj-devel709 opened this issue Oct 29, 2024 · 3 comments · May be fixed by #25691
Assignees
Labels
area-controls-editor Editor platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@tj-devel709
Copy link
Member

Description

The issue is when an editor is scaled down on older iOS versions, the text splits in the middle and moves on to the next line causing text to seem to disappear.

This issue was believed to be fixed with: #24859.
Removing the call to SizeThatFits seemed to not cause this scaling issue but it turns out this is only on iOS 17 and up.

On iOS 15.5, the bad editor scaling behavior is still present and on iOS 16.4, it seems that there is still slightly different, but wrong behavior.

Some things I've tried

  • I removed all references to the Placeholder label to see if that subview was doing anything strange and it does not look like this has any effect. Also removing the other calls in LayoutSubviews to UpdatePlaceholderLabelFrame() and ShouldCenterVertically() do not affect this behavior which leads me to believe this issue is happening on the backend of things.
  • It seems like the issue may be related to the ContentSize and the Bounds when scaling happens and these could perhaps be differences in how the different iOS versions handle it?

Inside the MauiTextView.LayoutSubviews method, I am setting a breakpoint and scaling down the editor by 0.5 and then scaling it back up to 1.0. It appears that there are two passes in the LayoutSubviews call and I capture the Bounds and ContentSize. The first image below shows iOS 17.0 and the second shows iOS 15.5. You'll even see when the editor on iOS 15.5 is at the full scale and appears on one line, it still has a much larger ContentSize.Height than the iOS 17.0 equivalent.

Steps to Reproduce

By adding the following code and then sliding the slider value, you'll see the editor will split the text into two lines on iOS 15.5 but not iOS 17+

    <ScrollView>
        <VerticalStackLayout>
            <Slider
                x:Name="mySlider"
                Minimum="0.5"
                Maximum="1"
                Value="1"/>

            <Editor
                x:Name="myEditor"
                Text="1234567890"
                Scale="{Binding Value, Source={x:Reference mySlider}}"
                Background="Red"
                FontSize="32"
                HorizontalOptions="Center"
                HorizontalTextAlignment="Center" />

        </VerticalStackLayout>
    </ScrollView>

Link to public reproduction project repository

No response

Version with bug

8.0.92 SR9.2

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5 - iOS 16.4

Did you find any workaround?

No response

Relevant log output

No response

Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@tj-devel709
Copy link
Member Author

To note: this happens in net8 and net9!

@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Oct 31, 2024
@ninachen03
Copy link

ninachen03 commented Oct 31, 2024

This issue has been verified using Visual Studio 17.12.0 Preview 5(8.0.82 & 9.0.0-rc.2.24503.2). Can repro this issue at iOS platform on 15.5-17.5. works fine on iOS18
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-editor Editor platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants