[release/11.0.1xx-preview2] Fix empty string binding to nullable value types#34245
Closed
github-actions[bot] wants to merge 3 commits intorelease/11.0.1xx-preview2from
Closed
Conversation
When binding Entry.Text to a nullable value type (e.g., int?), clearing the Entry now correctly sets the property to null instead of retaining the previous value. Fixes #8342
- Use string.IsNullOrEmpty instead of IsNullOrWhiteSpace so whitespace strings fail conversion rather than silently becoming null - Add 'value is string' guard to prevent non-string values from being incorrectly converted to null via the string.Empty fallback - Add tests for whitespace retention, double? nullable type, and re-entering a value after clearing
…tation The original fix that converted all null values to empty string for string targets broke existing tests that expect null to remain null. Reverted that change. The test now expects Entry.Text to be null (not "") after the nullable int becomes null, which is correct - Entry displays empty for both null and "" text values.
This was referenced Feb 25, 2026
Open
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #33536 to release/11.0.1xx-preview2
/cc @StephaneDelcroix