Skip to content

PropertyChanged triggered on empty string #872

Open
@karmeye

Description

@karmeye

Describe the bug

The following returns false even though both are empty strings

if (!global::System.Collections.Generic.EqualityComparer<string?>.Default.Equals(myString, value))

Regression

No response

Steps to reproduce

1. <TextBox Text="{x:Bind MyString, Mode=TwoWay}" />
2. Leave empty and tab in and out.
3. `OnPropertyChanged` (and the other methods) is called

Expected behavior

PropertyChanged should not be triggered when the new value is an empty string for a current empty string value.

Screenshots

No response

IDE and version

VS 2022

IDE version

No response

Nuget packages

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.2.2

Additional context

No response

Help us help you

No, just wanted to report this

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛An unexpected issue that highlights incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions