xamarin / Xamarin.Forms

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

[Bug] RequiredStringValidationBehavior stays invalid when it should be valid #15721

Closed CostasAthan closed 1 year ago

CostasAthan commented 1 year ago

Description

RequiredStringValidationBehavior stays always invalid

Steps to Reproduce

StackLayout myLayout = new StackLayout
{ 
    Children =
    {
        new Entry(),

        new Entry(),

        new Entry()
    }
};

myLayout.Children.OfType<Entry>().ElementAt(2).Behaviors.Add
(
     new RequiredStringValidationBehavior
      {
           RequiredString = myLayout.Children.OfType<Entry>().ElementAt(1).Text,
           InvalidStyle = invalidEntryStyle,
           Flags = ValidationFlags.ValidateOnValueChanging
      }
);
  1. Run the aforementioned code.
  2. Enter the same strings in both the second and the third Entries.

Expected Behavior

When both Entries have the same input the RequiredStringValidationBehavior should be valid.

Actual Behavior

The RequiredStringValidationBehavior stays invalid

Basic Information

jfversluis commented 1 year ago

The RequiredStringValidationBehavior is something that is not in Xamarin.Forms but the Xamarin Community Toolkit. Please report the issue there. Thanks!