Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NumericValidationBehavior Not Working in .NET 8 Preview 7 When Using AppThemeBinding #1389

Closed
2 tasks done
pvoelker opened this issue Sep 6, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working unverified

Comments

@pvoelker
Copy link

pvoelker commented Sep 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The entry field with 'NumericValidationBehavior' is not turning the text field red when it is out of range or not a number.

Expected Behavior

In the provided example. I would expect the single entry field to turn red when the value entered is:

  • Not an integer number
  • Lower than 1
  • Higher than 100

Steps To Reproduce

  1. Run the application in debug in Windows
  2. Enter the value '-1' in the entry. The field should turn red but it does not

Link to public reproduction project repository

https://github.com/pvoelker/NumericValidationBehaviorNET8Preview7Bug

Environment

- .NET MAUI CommunityToolkit: 5.3.0
- OS: Windows 11 Home (10.0.22621 Build 22621)
- .NET MAUI: 8.0.0-preview.7.8842

Anything else?

With my own experimentation, the issue seems to be with 'AppThemeBinding'. I had no problems using 'AppThemeBinding' with the valid entry text color style in .NET 7 MAUI. Once I updated to .NET 8 Preview 7, the validation stopped working.

If I change it to a static color (like 'blue') the validation works fine.

<Style x:Key="ValidEntryStyle" TargetType="Entry">
        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray100}}" />
</Style>

This could be an issue with MAUI in .NET 8 Preview 7. I figured I would start here first...

@pvoelker pvoelker added bug Something isn't working unverified labels Sep 6, 2023
@VladislavAntonyuk
Copy link
Collaborator

We don’t support .net 8 yet. Although you can try the NuGet package from this PR: #1367. Does it solve the issue?

@pvoelker
Copy link
Author

The issue for me is now moot since .NET 8 MAUI has other issues so I am sticking with .NET 7 MAUI for the time being. Thanks for the help on this

@mrwcjoughin
Copy link

mrwcjoughin commented Oct 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

3 participants