xamarin/Xamarin.Forms

[iOS] After Cell.ForceUpdateSize(), contained Entry has odd text entry behaviour

オープン

#4,067 opened on 2018/10/11

 (2 件のコメント) (2 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
a/listviewe/5 :clock5:excellent-reporthelp wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

After calling ForceUpdateSize() on a ViewCell with an Entry control, the keyboard hides after typing a character. If the Entry Text is bound, it only accepts 1 character.

Sample XAML:

<ListView x:Name="listView" HasUnevenRows="True">
    <ListView.ItemsSource>
        <x:Array Type="{x:Type x:String}">
            <x:String>A</x:String>
            <x:String>B</x:String>
        </x:Array>
    </ListView.ItemsSource>
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <Entry />
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

Codebehind calls ForceUpdateSize() on the first entry in MainPage_OnAppearing: listView.TemplatedItems.First().ForceUpdateSize();

Steps to Reproduce

  1. Compile and run attached iOS solution
  2. Select first Entry in ListView, try enter text.
  3. Notice second Entry in ListView behaves normally.

Expected Behavior

Keyboard should remain open, and bound data should reflect typed data.

Actual Behavior

Keyboard closes after single character entry, bound data is cleared and set to last typed character (multiple times).

Basic Information

  • Version with issue: Xamarin.Forms versions 3.2.0.871581, 3.3.0.871608-pre2
  • Last known good version:
  • IDE: VS 15.8.7
  • Platform Target Frameworks:
    • iOS: 12.0.1
    • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices: Tested on an iPhone 7

Screenshots

Reproduction Link

BasicXam.zip

コントリビューターガイド