Skip to content

Conversation

@Vignesh-SF3580
Copy link
Contributor

@Vignesh-SF3580 Vignesh-SF3580 commented Oct 3, 2025

Issue Detail

Selected tags are not restored on MainPage after returning from ProjectDetailPage.

Root Cause

After the changes introduced in PR-611, when a tag was initially selected, navigating to ProjectDetailPage caused it to be deleted in the ToggleTag method through the SelectionChanged  logic. This incorrect logic resulted in the selected tags being lost on the MainPage.

Description of Change

Updated SelectionChanged command logic that compares the current selection with the previous one, updates the IsSelected property for newly selected or deselected tags, and saves the changes to keep the selection state consistent across navigation.
 
Breaking changes: https://github.com/dotnet/maui-samples/pull/611/files#diff-cbae54bfccffc3323ca041b37c3e9be2c5515d8aa51ced752b277d5744eb3591
 
Break PR: #611

Screenshots

Before Issue Fix After Issue Fix
BeforeFix.mov
AfterFix.mov

@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review October 3, 2025 11:52
@jsuarezruiz jsuarezruiz self-requested a review October 6, 2025 14:39
{
await _tagRepository.DeleteItemAsync(tag, _project.ID);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to update SelectedTags to reflect current selection?

SelectedTags = new List<object>(currentSelection);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz Yes, I have updated the SelectedTags in SelectionChanged as suggested, it now reflects the current selection immediately when tags are selected.

@jsuarezruiz
Copy link
Contributor

This PR fixes dotnet/maui#30749

@jfversluis jfversluis merged commit 9a7264d into dotnet:main Oct 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants