Skip to content

Commit fd79c35

Browse files
authored
Merge pull request #310 from enisn/4.1-ignore-differenttype-comparison
Ignoring diffretent type comparison in validators
2 parents aa4b258 + 36d047b commit fd79c35

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/InputKit.Maui/InputKit.Maui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<SingleProject>true</SingleProject>
99
<MauiVersion>6.0.486</MauiVersion>
1010
<PackageId>InputKit.Maui</PackageId>
11-
<Version>4.1.0</Version>
11+
<Version>4.1.1</Version>
1212
<DefineConstants Condition="$(TargetFramework.Contains('-windows'))">$(DefineConstants);UWP</DefineConstants>
1313

1414
<!-- NuGet Package Info -->

src/InputKit.Maui/Shared/Validations/MaxValueValidation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public bool Validate(object value)
1313
}
1414

1515
var converted = ComparableTypeConverter.Instance.ConvertFrom(value);
16-
if (converted is IComparable comparable)
16+
if (converted is IComparable comparable && converted.GetType() == comparable.GetType())
1717
{
1818
return comparable.CompareTo(MaxValue) <= 0;
1919
}

src/InputKit.Maui/Shared/Validations/MinValueValidation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public bool Validate(object value)
1919

2020
var converted = ComparableTypeConverter.Instance.ConvertFrom(value);
2121

22-
if (converted is IComparable comparable)
22+
if (converted is IComparable comparable && converted.GetType() == comparable.GetType())
2323
{
2424
return comparable.CompareTo(MinValue) >= 0;
2525
}

src/Xamarin.Forms.InputKit/Shared/Validations/MaxValueValidation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public bool Validate(object value)
1616
}
1717

1818
var converted = ComparableTypeConverter.Instance.ConvertFrom(value);
19-
if (converted is IComparable comparable)
19+
if (converted is IComparable comparable && converted.GetType() == comparable.GetType())
2020
{
2121
return comparable.CompareTo(MaxValue) <= 0;
2222
}

src/Xamarin.Forms.InputKit/Shared/Validations/MinValueValidation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public bool Validate(object value)
2121

2222
var converted = ComparableTypeConverter.Instance.ConvertFrom(value);
2323

24-
if (converted is IComparable comparable)
24+
if (converted is IComparable comparable && converted.GetType() == comparable.GetType())
2525
{
2626
return comparable.CompareTo(MinValue) >= 0;
2727
}

src/Xamarin.Forms.InputKit/Xamarin.Forms.InputKit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RootNamespace>Plugin.InputKit</RootNamespace>
99
<PackageId>Xamarin.Forms.InputKit</PackageId>
1010
<Product>$(AssemblyName) ($(TargetFramework))</Product>
11-
<Version>4.1.0</Version>
11+
<Version>4.1.1</Version>
1212
<PackOnBuild>false</PackOnBuild>
1313
<NeutralLanguage>en-US</NeutralLanguage>
1414
<DefineConstants>$(DefineConstants);</DefineConstants>

0 commit comments

Comments
 (0)