xamarin/Xamarin.Forms

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

开放

#4,067 创建于 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

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 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

贡献者指南