xamarin/Xamarin.Forms

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

Offen

#4.067 geöffnet am 11.10.2018

 (2 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)C# (1.926 Forks)batch import
a/listviewe/5 :clock5:excellent-reporthelp wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository-Metriken

Stars
 (5.644 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide