xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

Editor text wrapping is wrongly calculated #3960

Closed kkolodziejczak closed 6 years ago

kkolodziejczak commented 6 years ago

Description

Text inside Editor is wrapped wrongly.

Steps to Reproduce

  1. Type some characters into Editor

Expected Behavior

StackLayout expands after one character appears on the next line.

Gif

Image from Gyazo

Actual Behavior

StackLayout expands only after some amount of characters is added to the next line. Amount of characters needed to reproduce depends from used characters and device. Adding spaces between characters dosen't help.

Gif

Image from Gyazo

Basic Information

Reproduction Link

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TestEditor"
             x:Class="TestEditor.MainPage">

    <StackLayout BackgroundColor="Red"
                 Spacing="25">
        <Grid BackgroundColor="White">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Label Text="Editor inside StackLayout"
                   Grid.Column="0"
                   Grid.Row="0"/>

            <StackLayout Grid.Column="0"
                         Grid.Row="1"
                         Padding="5,12"
                         >
                <Editor AutoSize="TextChanges"
                        VerticalOptions="FillAndExpand"
                        BackgroundColor="White"/>
            </StackLayout>

            <Label Text="x"
                   HorizontalOptions="Center"
                   Grid.Row="1"
                   Grid.Column="1"/>
        </Grid>

    </StackLayout>

</ContentPage>
kingces95 commented 6 years ago

App27.zip Failed to reproduce on latest 3.3.0 build on Android device.

kingces95 commented 6 years ago

Please re-open if your able to reproduce on the latest nightly or if additional environmental conditions are required. Thanks!

kkolodziejczak commented 6 years ago

Hi, I have tried it in your's project the only change that I did was changing Xamarin.Froms version to 3.4.0.894088-nightly. But it is still happening on device and emulator. Simple line of s characters breaks it every time.

Im using Windows 10 with Visual Studio 15.8.5, HTC M8 Android 6.0. Curently I don't have access to other devices. My emulator settings:

Name: Pixel_XL_API_23
CPU/ABI: Google APIs Intel Atom (x86)
Path: <SomePath>.android\avd\Pixel_XL_API_23.avd
Target: google_apis [Google APIs] (API level 23)
Skin: 1440x2560
SD Card: 100 MB
hw.dPad: no
hw.lcd.height: 2560
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_xl
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.lcd.width: 1440
hw.gps: yes
hw.initialOrientation: Portrait
skin.path.backup: _no_skin
image.androidVersion.api: 23
hw.audioInput: yes
image.sysdir.1: system-images\android-23\google_apis\x86\
tag.id: google_apis
showDeviceFrame: no
hw.camera.back: virtualscene
hw.mainKeys: no
AvdId: Pixel_XL_API_23
hw.camera.front: emulated
hw.lcd.density: 560
avd.ini.displayname: Pixel XL API 23
hw.arc: false
hw.gpu.mode: host
hw.device.hash2: MD5:984dbf66b1aaafcdb7e89573ffb74b46
hw.ramSize: 1536
hw.trackBall: no
PlayStore.enabled: false
fastboot.forceColdBoot: no
hw.battery: yes
hw.cpu.ncore: 2
hw.sdCard: no
tag.display: Google APIs
runtime.network.latency: none
hw.keyboard: yes
hw.sensors.proximity: yes
disk.dataPartition.size: 800M
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes