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] Information label and bound value in CompareConverter sample don't match #1980

Closed
2 tasks done
GeorgeLeithead opened this issue Jun 25, 2024 · 1 comment · Fixed by #1981
Closed
2 tasks done
Labels
area/converters Issue/Discussion/PR that has to do with Converters bug Something isn't working unverified

Comments

@GeorgeLeithead
Copy link
Contributor

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

In the CompareConverterPage sample, the Slider has a range of 0 to 10.

        <Slider
            HorizontalOptions="FillAndExpand"
            Maximum="10"
            Minimum="0"
            Value="{Binding SliderValue, Mode=TwoWay}" />

The ComparingValue is set to 0.5.

<x:Double x:Key="ComparingValue">0.5</x:Double>

The label text informs the user:

<Label Text="The following label will show whether the value of the slider is greater than or equal to 50%:" TextColor="{StaticResource NormalLabelTextColor}" />

As such, when the slider is a value of < 0.5 it indicates FALSE, but any value >= 0.5 it indicates TRUE. This does not match the label text, and is 0.5 instead of 5 (which is 50% of the slider range)
image
image

Expected Behavior

When the slider label is >=50% of it's range, the label should indicate TRUE, otherwise FALSE. As such, the ComparingValue should be 5 and not 0.5.

<x:Double x:Key="ComparingValue">5.0</x:Double>

Steps To Reproduce

  1. Open and run the Sample solution from the repo.
  2. Using the menu, go to Converters
  3. Select the CompareConverter
  4. Use the Slider to witness the bug.

Link to public reproduction project repository

https://github.com/GeorgeLeithead/CommunityToolkitMaui

Environment

- .NET MAUI CommunityToolkit: 9.0.1
- OS: Windows 11, or Android API 26 and above
- .NET MAUI: 8.0.6

Anything else?

No response

@GeorgeLeithead GeorgeLeithead added bug Something isn't working unverified labels Jun 25, 2024
@GeorgeLeithead
Copy link
Contributor Author

Changed to:

<x:Double x:Key="ComparingValue">5.0</x:Double>

Results:
image
image

GeorgeLeithead added a commit to GeorgeLeithead/CommunityToolkitMaui that referenced this issue Jun 25, 2024
@vhugogarcia vhugogarcia added the area/converters Issue/Discussion/PR that has to do with Converters label Jun 27, 2024
brminnick added a commit that referenced this issue Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/converters Issue/Discussion/PR that has to do with Converters bug Something isn't working unverified
Projects
None yet
2 participants